Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Side by Side Diff: chrome/browser/extensions/active_tab_unittest.cc

Issue 10703158: Change ActiveTabTest to do setup in SetUp rather than its constructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SetUp Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 class ActiveTabTest : public TabContentsTestHarness { 59 class ActiveTabTest : public TabContentsTestHarness {
60 public: 60 public:
61 ActiveTabTest() 61 ActiveTabTest()
62 : extension(CreateTestExtension("extension", true)), 62 : extension(CreateTestExtension("extension", true)),
63 another_extension(CreateTestExtension("another", true)), 63 another_extension(CreateTestExtension("another", true)),
64 extension_without_active_tab( 64 extension_without_active_tab(
65 CreateTestExtension("without activeTab", false)), 65 CreateTestExtension("without activeTab", false)),
66 ui_thread_(BrowserThread::UI, MessageLoop::current()) { 66 ui_thread_(BrowserThread::UI, MessageLoop::current()) {
67 }
68
69 virtual void SetUp() {
70 TabContentsTestHarness::SetUp();
67 Feature::SetChannelForTesting(chrome::VersionInfo::CHANNEL_UNKNOWN); 71 Feature::SetChannelForTesting(chrome::VersionInfo::CHANNEL_UNKNOWN);
68 } 72 }
69 73
70 protected: 74 protected:
71 int tab_id() { 75 int tab_id() {
72 return tab_contents()->extension_tab_helper()->tab_id(); 76 return tab_contents()->extension_tab_helper()->tab_id();
73 } 77 }
74 78
75 ActiveTabPermissionManager* active_tab_permission_manager() { 79 ActiveTabPermissionManager* active_tab_permission_manager() {
76 return tab_contents()->extension_tab_helper()-> 80 return tab_contents()->extension_tab_helper()->
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 NavigateAndCommit(google); 422 NavigateAndCommit(google);
419 423
420 active_tab_permission_manager()->GrantIfRequested(extension); 424 active_tab_permission_manager()->GrantIfRequested(extension);
421 425
422 EXPECT_TRUE(IsAllowed(extension, google, tab_id())); 426 EXPECT_TRUE(IsAllowed(extension, google, tab_id()));
423 EXPECT_TRUE(IsBlocked(extension, google, tab_id() + 1)); 427 EXPECT_TRUE(IsBlocked(extension, google, tab_id() + 1));
424 } 428 }
425 429
426 } // namespace 430 } // namespace
427 } // namespace extensions 431 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698