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

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

Issue 6125003: Make ExtensionBrowserEventRouter owned by ExtensionService.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 ExtensionAction* action = extension->browser_action(); 62 ExtensionAction* action = extension->browser_action();
63 ASSERT_EQ("Modified", action->GetTitle(ExtensionAction::kDefaultTabId)); 63 ASSERT_EQ("Modified", action->GetTitle(ExtensionAction::kDefaultTabId));
64 ASSERT_EQ("badge", action->GetBadgeText(ExtensionAction::kDefaultTabId)); 64 ASSERT_EQ("badge", action->GetBadgeText(ExtensionAction::kDefaultTabId));
65 ASSERT_EQ(SkColorSetARGB(255, 255, 255, 255), 65 ASSERT_EQ(SkColorSetARGB(255, 255, 255, 255),
66 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId)); 66 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId));
67 67
68 // Simulate the browser action being clicked. 68 // Simulate the browser action being clicked.
69 ui_test_utils::NavigateToURL(browser(), 69 ui_test_utils::NavigateToURL(browser(),
70 test_server()->GetURL("files/extensions/test_file.txt")); 70 test_server()->GetURL("files/extensions/test_file.txt"));
71 71
72 ExtensionBrowserEventRouter::GetInstance()->BrowserActionExecuted( 72 ExtensionService* service = browser()->profile()->GetExtensionService();
73 service->browser_event_router()->BrowserActionExecuted(
73 browser()->profile(), action->extension_id(), browser()); 74 browser()->profile(), action->extension_id(), browser());
74 75
75 // Verify the command worked. 76 // Verify the command worked.
76 TabContents* tab = browser()->GetSelectedTabContents(); 77 TabContents* tab = browser()->GetSelectedTabContents();
77 bool result = false; 78 bool result = false;
78 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 79 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
79 tab->render_view_host(), L"", 80 tab->render_view_host(), L"",
80 L"setInterval(function(){" 81 L"setInterval(function(){"
81 L" if(document.body.bgColor == 'red'){" 82 L" if(document.body.bgColor == 'red'){"
82 L" window.domAutomationController.send(true)}}, 100)", 83 L" window.domAutomationController.send(true)}}, 100)",
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 service->toolbar_model()->MoveBrowserAction( 362 service->toolbar_model()->MoveBrowserAction(
362 service->extensions()->at(size_before + 1), 1); 363 service->extensions()->at(size_before + 1), 1);
363 364
364 EXPECT_EQ(kTooltipC, GetBrowserActionsBar().GetTooltip(0)); 365 EXPECT_EQ(kTooltipC, GetBrowserActionsBar().GetTooltip(0));
365 EXPECT_EQ(kTooltipB, GetBrowserActionsBar().GetTooltip(1)); 366 EXPECT_EQ(kTooltipB, GetBrowserActionsBar().GetTooltip(1));
366 EXPECT_EQ(kTooltipA, GetBrowserActionsBar().GetTooltip(2)); 367 EXPECT_EQ(kTooltipA, GetBrowserActionsBar().GetTooltip(2));
367 368
368 EXPECT_EQ(kTooltipC, incognito_bar.GetTooltip(0)); 369 EXPECT_EQ(kTooltipC, incognito_bar.GetTooltip(0));
369 EXPECT_EQ(kTooltipA, incognito_bar.GetTooltip(1)); 370 EXPECT_EQ(kTooltipA, incognito_bar.GetTooltip(1));
370 } 371 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/extensions/extension_browser_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698