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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container_browsertest.cc

Issue 10592022: Get rid of the multiple includes of browser_action_test_util files in browser.lib and browser_tests… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | « chrome/browser/ui/views/browser_action_test_util_views.cc ('k') | chrome/chrome_tests.gypi » ('j') | 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 "chrome/browser/extensions/browser_action_test_util.h" 5 #include "chrome/browser/extensions/browser_action_test_util.h"
6 #include "chrome/browser/extensions/extension_browsertest.h" 6 #include "chrome/browser/extensions/extension_browsertest.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/views/browser_actions_container.h" 10 #include "chrome/browser/ui/views/browser_actions_container.h"
11 #include "chrome/common/chrome_notification_types.h"
11 #include "chrome/common/extensions/extension_action.h" 12 #include "chrome/common/extensions/extension_action.h"
12 #include "chrome/common/extensions/extension_resource.h" 13 #include "chrome/common/extensions/extension_resource.h"
14 #include "chrome/test/base/ui_test_utils.h"
13 15
14 using extensions::Extension; 16 using extensions::Extension;
15 17
16 class BrowserActionsContainerTest : public ExtensionBrowserTest { 18 class BrowserActionsContainerTest : public ExtensionBrowserTest {
17 public: 19 public:
18 BrowserActionsContainerTest() { 20 BrowserActionsContainerTest() {
19 } 21 }
20 virtual ~BrowserActionsContainerTest() {} 22 virtual ~BrowserActionsContainerTest() {}
21 23
22 virtual void SetUpOnMainThread() OVERRIDE { 24 virtual void SetUpOnMainThread() OVERRIDE {
23 browser_actions_bar_.reset(new BrowserActionTestUtil(browser())); 25 browser_actions_bar_.reset(new BrowserActionTestUtil(browser()));
24 } 26 }
25 27
26 BrowserActionTestUtil* browser_actions_bar() { 28 BrowserActionTestUtil* browser_actions_bar() {
27 return browser_actions_bar_.get(); 29 return browser_actions_bar_.get();
28 } 30 }
29 31
30 // Make sure extension with index |extension_index| has an icon. 32 // Make sure extension with index |extension_index| has an icon.
31 void EnsureExtensionHasIcon(int extension_index) { 33 void EnsureExtensionHasIcon(int extension_index) {
32 if (!browser_actions_bar_->HasIcon(extension_index)) { 34 if (!browser_actions_bar_->HasIcon(extension_index)) {
33 // The icon is loaded asynchronously and a notification is then sent to 35 // The icon is loaded asynchronously and a notification is then sent to
34 // observers. So we wait on it. 36 // observers. So we wait on it.
35 browser_actions_bar_->WaitForBrowserActionUpdated(extension_index); 37 ExtensionAction* browser_action =
38 browser_actions_bar_->GetExtensionAction(extension_index);
39
40 ui_test_utils::WindowedNotificationObserver observer(
41 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
42 content::Source<ExtensionAction>(browser_action));
43 observer.Wait();
36 } 44 }
37 EXPECT_TRUE(browser_actions_bar()->HasIcon(extension_index)); 45 EXPECT_TRUE(browser_actions_bar()->HasIcon(extension_index));
38 } 46 }
39 47
40 private: 48 private:
41 scoped_ptr<BrowserActionTestUtil> browser_actions_bar_; 49 scoped_ptr<BrowserActionTestUtil> browser_actions_bar_;
42 }; 50 };
43 51
44 // Test the basic functionality. 52 // Test the basic functionality.
45 // http://crbug.com/120770 53 // http://crbug.com/120770
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 extension->GetResource(extension->browser_action()->default_icon_path()), 276 extension->GetResource(extension->browser_action()->default_icon_path()),
269 bitmap, 277 bitmap,
270 size); 278 size);
271 279
272 LOG(INFO) << "Disabling extension\n" << std::flush; 280 LOG(INFO) << "Disabling extension\n" << std::flush;
273 DisableExtension(extension->id()); 281 DisableExtension(extension->id());
274 LOG(INFO) << "Enabling extension\n" << std::flush; 282 LOG(INFO) << "Enabling extension\n" << std::flush;
275 EnableExtension(extension->id()); 283 EnableExtension(extension->id());
276 LOG(INFO) << "Test ending\n" << std::flush; 284 LOG(INFO) << "Test ending\n" << std::flush;
277 } 285 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/browser_action_test_util_views.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698