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

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

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only 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 "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 25 matching lines...) Expand all
36 36
37 class ScriptBadgeControllerTest : public TabContentsTestHarness { 37 class ScriptBadgeControllerTest : public TabContentsTestHarness {
38 public: 38 public:
39 ScriptBadgeControllerTest() 39 ScriptBadgeControllerTest()
40 : ui_thread_(BrowserThread::UI, MessageLoop::current()), 40 : ui_thread_(BrowserThread::UI, MessageLoop::current()),
41 file_thread_(BrowserThread::FILE, MessageLoop::current()), 41 file_thread_(BrowserThread::FILE, MessageLoop::current()),
42 current_channel_(chrome::VersionInfo::CHANNEL_DEV) {} 42 current_channel_(chrome::VersionInfo::CHANNEL_DEV) {}
43 43
44 virtual void SetUp() OVERRIDE { 44 virtual void SetUp() OVERRIDE {
45 // Note that this sets a PageActionController into the 45 // Note that this sets a PageActionController into the
46 // extension_tab_helper()->location_bar_controller() field. Do 46 // extensions::TabHelper's location_bar_controller field. Do
47 // not use that for testing. 47 // not use that for testing.
48 TabContentsTestHarness::SetUp(); 48 TabContentsTestHarness::SetUp();
49 49
50 TestExtensionSystem* extension_system = 50 TestExtensionSystem* extension_system =
51 static_cast<TestExtensionSystem*>(ExtensionSystem::Get( 51 static_cast<TestExtensionSystem*>(ExtensionSystem::Get(
52 tab_contents()->profile())); 52 tab_contents()->profile()));
53 53
54 // Create an ExtensionService so the ScriptBadgeController can find its 54 // Create an ExtensionService so the ScriptBadgeController can find its
55 // extensions. 55 // extensions.
56 CommandLine command_line(CommandLine::NO_PROGRAM); 56 CommandLine command_line(CommandLine::NO_PROGRAM);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Getting attention a second time should have no effect. 240 // Getting attention a second time should have no effect.
241 script_badge_controller_->GetAttentionFor(extension->id()); 241 script_badge_controller_->GetAttentionFor(extension->id());
242 242
243 EXPECT_THAT(script_badge_controller_->GetCurrentActions(), 243 EXPECT_THAT(script_badge_controller_->GetCurrentActions(),
244 testing::ElementsAre(extension->script_badge())); 244 testing::ElementsAre(extension->script_badge()));
245 EXPECT_EQ(0, subsequent_get_attention_call.events); 245 EXPECT_EQ(0, subsequent_get_attention_call.events);
246 }; 246 };
247 247
248 } // namespace 248 } // namespace
249 } // namespace extensions 249 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/script_badge_controller.cc ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698