| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 TestBrowserPluginEmbedder* test_embedder_; | 368 TestBrowserPluginEmbedder* test_embedder_; |
| 369 TestBrowserPluginGuest* test_guest_; | 369 TestBrowserPluginGuest* test_guest_; |
| 370 TestBrowserPluginGuestManager* test_guest_manager_; | 370 TestBrowserPluginGuestManager* test_guest_manager_; |
| 371 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostTest); | 371 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostTest); |
| 372 }; | 372 }; |
| 373 | 373 |
| 374 // This test loads a guest that has a busy loop, and therefore it hangs the | 374 // This test loads a guest that has a busy loop, and therefore it hangs the |
| 375 // guest. | 375 // guest. |
| 376 // | 376 // |
| 377 // Disabled on Windows and Linux since it is flaky. crbug.com/164812 | 377 // Disabled on Windows and Linux since it is flaky. crbug.com/164812 |
| 378 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, GuestUnresponsive) { | 378 // THIS TEST IS ALWAYS FLAKY. DO NOT ENABLE AGAIN WITHOUT REWRITING. |
| 379 #if defined(OS_WIN) || defined(OS_LINUX) |
| 380 #define MAYBE_GuestUnresponsive DISABLED_GuestUnresponsive |
| 381 #else |
| 382 #define MAYBE_GuestUnresponsive GuestUnresponsive |
| 383 #endif |
| 384 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, |
| 385 MAYBE_GuestUnresponsive) { |
| 379 // Override the hang timeout for guest to be very small. | 386 // Override the hang timeout for guest to be very small. |
| 380 content::BrowserPluginGuest::set_factory_for_testing( | 387 content::BrowserPluginGuest::set_factory_for_testing( |
| 381 TestShortHangTimeoutGuestFactory::GetInstance()); | 388 TestShortHangTimeoutGuestFactory::GetInstance()); |
| 382 const char kEmbedderURL[] = | 389 const char kEmbedderURL[] = |
| 383 "files/browser_plugin_embedder_guest_unresponsive.html"; | 390 "files/browser_plugin_embedder_guest_unresponsive.html"; |
| 384 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestBusyLoop, true, ""); | 391 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestBusyLoop, true, ""); |
| 385 // Wait until the busy loop starts. | 392 // Wait until the busy loop starts. |
| 386 { | 393 { |
| 387 const string16 expected_title = ASCIIToUTF16("start"); | 394 const string16 expected_title = ASCIIToUTF16("start"); |
| 388 content::TitleWatcher title_watcher(test_guest()->web_contents(), | 395 content::TitleWatcher title_watcher(test_guest()->web_contents(), |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 const string16 expected_title = ASCIIToUTF16("AutoSize(640, 480)"); | 1392 const string16 expected_title = ASCIIToUTF16("AutoSize(640, 480)"); |
| 1386 content::TitleWatcher title_watcher(test_embedder()->web_contents(), | 1393 content::TitleWatcher title_watcher(test_embedder()->web_contents(), |
| 1387 expected_title); | 1394 expected_title); |
| 1388 RemoveAttributes(rvh, "maxwidth"); | 1395 RemoveAttributes(rvh, "maxwidth"); |
| 1389 string16 actual_title = title_watcher.WaitAndGetTitle(); | 1396 string16 actual_title = title_watcher.WaitAndGetTitle(); |
| 1390 EXPECT_EQ(expected_title, actual_title); | 1397 EXPECT_EQ(expected_title, actual_title); |
| 1391 } | 1398 } |
| 1392 } | 1399 } |
| 1393 | 1400 |
| 1394 } // namespace content | 1401 } // namespace content |
| OLD | NEW |