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

Side by Side Diff: chrome/test/gpu/webgl_infobar_browsertest.cc

Issue 228293004: InfoBarService inherits from InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 8 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 9 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
10 #include "chrome/browser/infobars/infobar.h" 10 #include "chrome/browser/infobars/infobar.h"
11 #include "chrome/browser/infobars/infobar_manager.h"
12 #include "chrome/browser/infobars/infobar_service.h" 11 #include "chrome/browser/infobars/infobar_service.h"
13 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_commands.h" 13 #include "chrome/browser/ui/browser_commands.h"
15 #include "chrome/browser/ui/browser_navigator.h" 14 #include "chrome/browser/ui/browser_navigator.h"
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" 15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
17 #include "chrome/common/chrome_paths.h" 16 #include "chrome/common/chrome_paths.h"
18 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
20 #include "chrome/test/base/in_process_browser_test.h" 19 #include "chrome/test/base/in_process_browser_test.h"
21 #include "chrome/test/base/test_launcher_utils.h" 20 #include "chrome/test/base/test_launcher_utils.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 gpu_test_dir_.AppendASCII("webgl.html"), "query=kill")); 83 gpu_test_dir_.AppendASCII("webgl.html"), "query=kill"));
85 observer.Wait(); 84 observer.Wait();
86 85
87 content::WindowedNotificationObserver infobar_added( 86 content::WindowedNotificationObserver infobar_added(
88 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, 87 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
89 content::NotificationService::AllSources()); 88 content::NotificationService::AllSources());
90 SimulateGPUCrash(browser()); 89 SimulateGPUCrash(browser());
91 infobar_added.Wait(); 90 infobar_added.Wait();
92 EXPECT_EQ(1u, 91 EXPECT_EQ(1u,
93 InfoBarService::FromWebContents( 92 InfoBarService::FromWebContents(
94 browser()->tab_strip_model()->GetActiveWebContents()) 93 browser()->tab_strip_model()->GetActiveWebContents())->
95 ->infobar_manager()->infobar_count()); 94 infobar_count());
96 } 95 }
97 96
98 // This test is flaky. http://crbug.com/324555 97 // This test is flaky. http://crbug.com/324555
99 IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossInfoBarReload) { 98 IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossInfoBarReload) {
100 #if defined(OS_WIN) && defined(USE_ASH) 99 #if defined(OS_WIN) && defined(USE_ASH)
101 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 100 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
102 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) 101 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests))
103 return; 102 return;
104 #endif 103 #endif
105 104
(...skipping 19 matching lines...) Expand all
125 124
126 message_queue.ClearQueue(); 125 message_queue.ClearQueue();
127 126
128 content::WindowedNotificationObserver infobar_added( 127 content::WindowedNotificationObserver infobar_added(
129 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, 128 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
130 content::NotificationService::AllSources()); 129 content::NotificationService::AllSources());
131 SimulateGPUCrash(browser()); 130 SimulateGPUCrash(browser());
132 infobar_added.Wait(); 131 infobar_added.Wait();
133 InfoBarService* infobar_service = InfoBarService::FromWebContents( 132 InfoBarService* infobar_service = InfoBarService::FromWebContents(
134 browser()->tab_strip_model()->GetActiveWebContents()); 133 browser()->tab_strip_model()->GetActiveWebContents());
135 ASSERT_EQ(1u, infobar_service->infobar_manager()->infobar_count()); 134 ASSERT_EQ(1u, infobar_service->infobar_count());
136 InfoBarDelegate* delegate = 135 InfoBarDelegate* delegate = infobar_service->infobar_at(0)->delegate();
137 infobar_service->infobar_manager()->infobar_at(0)->delegate();
138 ASSERT_EQ(IDR_INFOBAR_3D_BLOCKED, delegate->GetIconID()); 136 ASSERT_EQ(IDR_INFOBAR_3D_BLOCKED, delegate->GetIconID());
139 delegate->AsConfirmInfoBarDelegate()->Cancel(); 137 delegate->AsConfirmInfoBarDelegate()->Cancel();
140 138
141 // The page should reload and another message sent to the 139 // The page should reload and another message sent to the
142 // DomAutomationController. 140 // DomAutomationController.
143 m.clear(); 141 m.clear();
144 ASSERT_TRUE(message_queue.WaitForMessage(&m)); 142 ASSERT_TRUE(message_queue.WaitForMessage(&m));
145 EXPECT_EQ("\"LOADED\"", m); 143 EXPECT_EQ("\"LOADED\"", m);
146 } 144 }
147 145
148 // There isn't any point in adding a test which calls Accept() on the 146 // There isn't any point in adding a test which calls Accept() on the
149 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and 147 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and
150 // there's no concrete event that could be observed in response. 148 // there's no concrete event that could be observed in response.
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_unittest.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698