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

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

Issue 10912156: Move SessionID, CaptureVisibleTabFunction to WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase atop the extension tab helper change Created 8 years, 3 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
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/command_line.h" 7 #include "base/command_line.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 "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 26 matching lines...) Expand all
37 CommandLine command_line(CommandLine::NO_PROGRAM); 37 CommandLine command_line(CommandLine::NO_PROGRAM);
38 extension_service_ = 38 extension_service_ =
39 static_cast<TestExtensionSystem*>( 39 static_cast<TestExtensionSystem*>(
40 ExtensionSystem::Get(tab_contents()->profile()))-> 40 ExtensionSystem::Get(tab_contents()->profile()))->
41 CreateExtensionService( 41 CreateExtensionService(
42 &command_line, FilePath(), false); 42 &command_line, FilePath(), false);
43 } 43 }
44 44
45 protected: 45 protected:
46 int tab_id() { 46 int tab_id() {
47 return SessionID::IdForTab(tab_contents()); 47 return SessionID::IdForTab(web_contents());
48 } 48 }
49 49
50 ExtensionService* extension_service_; 50 ExtensionService* extension_service_;
51 51
52 private: 52 private:
53 content::TestBrowserThread ui_thread_; 53 content::TestBrowserThread ui_thread_;
54 content::TestBrowserThread file_thread_; 54 content::TestBrowserThread file_thread_;
55 }; 55 };
56 56
57 TEST_F(PageActionControllerTest, NavigationClearsState) { 57 TEST_F(PageActionControllerTest, NavigationClearsState) {
(...skipping 29 matching lines...) Expand all
87 87
88 // Should discard the settings, and go back to the defaults. 88 // Should discard the settings, and go back to the defaults.
89 NavigateAndCommit(GURL("http://www.yahoo.com")); 89 NavigateAndCommit(GURL("http://www.yahoo.com"));
90 90
91 EXPECT_EQ("Hello", extension->page_action()->GetTitle(tab_id())); 91 EXPECT_EQ("Hello", extension->page_action()->GetTitle(tab_id()));
92 EXPECT_EQ(GURL(), extension->page_action()->GetPopupUrl(tab_id())); 92 EXPECT_EQ(GURL(), extension->page_action()->GetPopupUrl(tab_id()));
93 }; 93 };
94 94
95 } // namespace 95 } // namespace
96 } // namespace extensions 96 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/page_action_controller.cc ('k') | chrome/browser/extensions/script_badge_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698