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

Side by Side Diff: chrome/test/plugin/pdf_browsertest.cc

Issue 6730016: Fix flakiness and enable RenderViewHostManagerTest on Linux/Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix additional flakiness. Created 9 years, 9 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) 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 std::string text; 246 std::string text;
247 clipboard.ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &text); 247 clipboard.ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &text);
248 ASSERT_EQ("adipiscing", text); 248 ASSERT_EQ("adipiscing", text);
249 } 249 }
250 250
251 // Tests that loading async pdfs works correctly (i.e. document fully loads). 251 // Tests that loading async pdfs works correctly (i.e. document fully loads).
252 // This also loads all documents that used to crash, to ensure we don't have 252 // This also loads all documents that used to crash, to ensure we don't have
253 // regressions. 253 // regressions.
254 // Flaky as per http://crbug.com/74548. 254 // Flaky as per http://crbug.com/74548.
255 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_SLOW_Loading) { 255 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_SLOW_Loading) {
Charlie Reis 2011/03/24 23:15:39 I'm going to keep this marked flaky, since it alre
256 ASSERT_TRUE(pdf_test_server()->Start()); 256 ASSERT_TRUE(pdf_test_server()->Start());
257 257
258 NavigationController* controller = 258 NavigationController* controller =
259 &(browser()->GetSelectedTabContents()->controller()); 259 &(browser()->GetSelectedTabContents()->controller());
260 NotificationRegistrar registrar; 260 NotificationRegistrar registrar;
261 registrar.Add(this, 261 registrar.Add(this,
262 NotificationType::LOAD_STOP, 262 NotificationType::LOAD_STOP,
263 Source<NavigationController>(controller)); 263 Source<NavigationController>(controller));
264 std::string base_url = std::string("files/"); 264 std::string base_url = std::string("files/");
265 265
(...skipping 29 matching lines...) Expand all
295 std::wstring(), 295 std::wstring(),
296 L"window.domAutomationController.send(plugin.documentLoadComplete())", 296 L"window.domAutomationController.send(plugin.documentLoadComplete())",
297 &complete)); 297 &complete));
298 if (complete) 298 if (complete)
299 break; 299 break;
300 300
301 // Check if the LOAD_STOP notification could have come while we run a 301 // Check if the LOAD_STOP notification could have come while we run a
302 // nested message loop for the JS call. 302 // nested message loop for the JS call.
303 if (last_count != load_stop_notification_count()) 303 if (last_count != load_stop_notification_count())
304 continue; 304 continue;
305 ui_test_utils::WaitForLoadStop(controller); 305 ui_test_utils::WaitForLoadStop(browser()->GetSelectedTabContents());
306 } 306 }
307 } 307 }
308 } 308 }
309 309
310 // Flaky as per http://crbug.com/74549. 310 // Flaky as per http://crbug.com/74549.
311 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_OnLoadAndReload) { 311 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_OnLoadAndReload) {
312 ASSERT_TRUE(pdf_test_server()->Start()); 312 ASSERT_TRUE(pdf_test_server()->Start());
313 313
314 GURL url = pdf_test_server()->GetURL("files/onload_reload.html"); 314 GURL url = pdf_test_server()->GetURL("files/onload_reload.html");
315 ui_test_utils::NavigateToURL(browser(), url); 315 ui_test_utils::NavigateToURL(browser(), url);
316 316
317 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( 317 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
318 browser()->GetSelectedTabContents()->render_view_host(), 318 browser()->GetSelectedTabContents()->render_view_host(),
319 std::wstring(), 319 std::wstring(),
320 L"reloadPDF();")); 320 L"reloadPDF();"));
321 321
322 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); 322 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
323 ASSERT_EQ("success", browser()->GetSelectedTabContents()->GetURL().query()); 323 ASSERT_EQ("success", browser()->GetSelectedTabContents()->GetURL().query());
324 } 324 }
325 325
326 } // namespace 326 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698