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

Side by Side Diff: chrome/browser/ui/pdf/pdf_browsertest.cc

Issue 10823029: Move WaitForLoadStop from ui_test_utils to browser_test_utils so that it can be reused in content_b… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 std::wstring(), 327 std::wstring(),
328 L"window.domAutomationController.send(plugin.documentLoadComplete())", 328 L"window.domAutomationController.send(plugin.documentLoadComplete())",
329 &complete)); 329 &complete));
330 if (complete) 330 if (complete)
331 break; 331 break;
332 332
333 // Check if the LOAD_STOP notification could have come while we run a 333 // Check if the LOAD_STOP notification could have come while we run a
334 // nested message loop for the JS call. 334 // nested message loop for the JS call.
335 if (last_count != load_stop_notification_count()) 335 if (last_count != load_stop_notification_count())
336 continue; 336 continue;
337 ui_test_utils::WaitForLoadStop(chrome::GetActiveWebContents(browser())); 337 content::WaitForLoadStop(chrome::GetActiveWebContents(browser()));
338 } 338 }
339 } 339 }
340 } 340 }
341 341
342 // Flaky as per http://crbug.com/74549. 342 // Flaky as per http://crbug.com/74549.
343 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, DISABLED_OnLoadAndReload) { 343 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, DISABLED_OnLoadAndReload) {
344 ASSERT_TRUE(pdf_test_server()->Start()); 344 ASSERT_TRUE(pdf_test_server()->Start());
345 345
346 GURL url = pdf_test_server()->GetURL("files/onload_reload.html"); 346 GURL url = pdf_test_server()->GetURL("files/onload_reload.html");
347 ui_test_utils::NavigateToURL(browser(), url); 347 ui_test_utils::NavigateToURL(browser(), url);
348 348
349 content::WindowedNotificationObserver observer( 349 content::WindowedNotificationObserver observer(
350 content::NOTIFICATION_LOAD_STOP, 350 content::NOTIFICATION_LOAD_STOP,
351 content::Source<NavigationController>( 351 content::Source<NavigationController>(
352 &chrome::GetActiveWebContents(browser())->GetController())); 352 &chrome::GetActiveWebContents(browser())->GetController()));
353 ASSERT_TRUE(content::ExecuteJavaScript( 353 ASSERT_TRUE(content::ExecuteJavaScript(
354 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), 354 chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
355 std::wstring(), 355 std::wstring(),
356 L"reloadPDF();")); 356 L"reloadPDF();"));
357 observer.Wait(); 357 observer.Wait();
358 358
359 ASSERT_EQ("success", 359 ASSERT_EQ("success",
360 chrome::GetActiveWebContents(browser())->GetURL().query()); 360 chrome::GetActiveWebContents(browser())->GetURL().query());
361 } 361 }
362 362
363 } // namespace 363 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_close_browsertest.cc ('k') | chrome/browser/ui/views/ssl_client_certificate_selector_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698