OLD | NEW |
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 Loading... |
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 |
OLD | NEW |