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

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

Issue 8587001: Have ExtensionHost use TabContents instead of RenderViewHost. Try #3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 20 matching lines...) Expand all
31 virtual ~BrowserActionApiTest() {} 31 virtual ~BrowserActionApiTest() {}
32 32
33 protected: 33 protected:
34 BrowserActionTestUtil GetBrowserActionsBar() { 34 BrowserActionTestUtil GetBrowserActionsBar() {
35 return BrowserActionTestUtil(browser()); 35 return BrowserActionTestUtil(browser());
36 } 36 }
37 37
38 bool OpenPopup(int index) { 38 bool OpenPopup(int index) {
39 ResultCatcher catcher; 39 ResultCatcher catcher;
40 ui_test_utils::WindowedNotificationObserver popup_observer( 40 ui_test_utils::WindowedNotificationObserver popup_observer(
41 chrome::NOTIFICATION_EXTENSION_POPUP_VIEW_READY, 41 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
42 content::NotificationService::AllSources()); 42 content::NotificationService::AllSources());
43 GetBrowserActionsBar().Press(index); 43 GetBrowserActionsBar().Press(index);
44 popup_observer.Wait(); 44 popup_observer.Wait();
45 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 45 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
46 return GetBrowserActionsBar().HasPopup(); 46 return GetBrowserActionsBar().HasPopup();
47 } 47 }
48 }; 48 };
49 49
50 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, Basic) { 50 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, Basic) {
51 ASSERT_TRUE(test_server()->Start()); 51 ASSERT_TRUE(test_server()->Start());
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 BrowserActionExecuted( 405 BrowserActionExecuted(
406 browser()->profile(), action->extension_id(), browser()); 406 browser()->profile(), action->extension_id(), browser());
407 407
408 // It can take a moment for the background page to actually get destroyed 408 // It can take a moment for the background page to actually get destroyed
409 // so we wait for the notification before checking that it's really gone 409 // so we wait for the notification before checking that it's really gone
410 // and the badge text has been set. 410 // and the badge text has been set.
411 host_destroyed_observer.Wait(); 411 host_destroyed_observer.Wait();
412 ASSERT_FALSE(manager->GetBackgroundHostForExtension(extension->id())); 412 ASSERT_FALSE(manager->GetBackgroundHostForExtension(extension->id()));
413 ASSERT_EQ("X", action->GetBadgeText(ExtensionAction::kDefaultTabId)); 413 ASSERT_EQ("X", action->GetBadgeText(ExtensionAction::kDefaultTabId));
414 } 414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698