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

Side by Side Diff: chrome/browser/ui/location_bar/location_bar_browsertest.cc

Issue 584513003: Move extension_test_message_listener to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
9 #include "chrome/browser/extensions/extension_action.h" 9 #include "chrome/browser/extensions/extension_action.h"
10 #include "chrome/browser/extensions/extension_action_manager.h" 10 #include "chrome/browser/extensions/extension_action_manager.h"
11 #include "chrome/browser/extensions/extension_browsertest.h" 11 #include "chrome/browser/extensions/extension_browsertest.h"
12 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_test_message_listener.h"
14 #include "chrome/browser/extensions/test_extension_dir.h" 13 #include "chrome/browser/extensions/test_extension_dir.h"
15 #include "chrome/browser/sessions/session_tab_helper.h" 14 #include "chrome/browser/sessions/session_tab_helper.h"
16 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_window.h" 16 #include "chrome/browser/ui/browser_window.h"
18 #include "chrome/browser/ui/location_bar/location_bar.h" 17 #include "chrome/browser/ui/location_bar/location_bar.h"
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" 18 #include "chrome/browser/ui/tabs/tab_strip_model.h"
20 #include "extensions/common/extension.h" 19 #include "extensions/common/extension.h"
21 #include "extensions/common/extension_builder.h" 20 #include "extensions/common/extension_builder.h"
22 #include "extensions/common/feature_switch.h" 21 #include "extensions/common/feature_switch.h"
23 #include "extensions/common/value_builder.h" 22 #include "extensions/common/value_builder.h"
23 #include "extensions/test/extension_test_message_listener.h"
24 24
25 namespace { 25 namespace {
26 26
27 const char kBackgroundScriptSource[] = 27 const char kBackgroundScriptSource[] =
28 "chrome.pageAction.onClicked.addListener(function() {\n" 28 "chrome.pageAction.onClicked.addListener(function() {\n"
29 " chrome.test.sendMessage('clicked');\n" 29 " chrome.test.sendMessage('clicked');\n"
30 "});\n" 30 "});\n"
31 "chrome.test.sendMessage('registered');\n"; 31 "chrome.test.sendMessage('registered');\n";
32 const char kManifestSource[] = 32 const char kManifestSource[] =
33 "{" 33 "{"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 browser()->tab_strip_model()->GetActiveWebContents(); 210 browser()->tab_strip_model()->GetActiveWebContents();
211 int tab_id = SessionTabHelper::IdForTab(tab); 211 int tab_id = SessionTabHelper::IdForTab(tab);
212 action->SetIsVisible(tab_id, true); 212 action->SetIsVisible(tab_id, true);
213 extensions::ExtensionActionAPI::Get(profile())->NotifyChange( 213 extensions::ExtensionActionAPI::Get(profile())->NotifyChange(
214 action, tab, profile()); 214 action, tab, profile());
215 215
216 // We should still have no page actions. 216 // We should still have no page actions.
217 EXPECT_EQ(0, location_bar->PageActionCount()); 217 EXPECT_EQ(0, location_bar->PageActionCount());
218 EXPECT_EQ(0, location_bar->PageActionVisibleCount()); 218 EXPECT_EQ(0, location_bar->PageActionVisibleCount());
219 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698