| 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/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 9 #include "chrome/browser/api/infobars/infobar_service.h" | 9 #include "chrome/browser/api/infobars/infobar_service.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 virtual void SetUpInProcessBrowserTestFixture() { | 58 virtual void SetUpInProcessBrowserTestFixture() { |
| 59 FilePath test_dir; | 59 FilePath test_dir; |
| 60 ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); | 60 ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); |
| 61 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 61 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
| 62 } | 62 } |
| 63 FilePath gpu_test_dir_; | 63 FilePath gpu_test_dir_; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { | 66 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { |
| 67 // crbug.com/162982, flaky on Mac Retina Release. | 67 if (GPUTestBotConfig::CurrentConfigMatches("XP")) |
| 68 if (GPUTestBotConfig::CurrentConfigMatches("MAC NVIDIA 0x0fd5 RELEASE")) | |
| 69 return; | 68 return; |
| 70 | 69 |
| 71 // Load page and wait for it to load. | 70 // Load page and wait for it to load. |
| 72 content::WindowedNotificationObserver observer( | 71 content::WindowedNotificationObserver observer( |
| 73 content::NOTIFICATION_LOAD_STOP, | 72 content::NOTIFICATION_LOAD_STOP, |
| 74 content::NotificationService::AllSources()); | 73 content::NotificationService::AllSources()); |
| 75 ui_test_utils::NavigateToURL( | 74 ui_test_utils::NavigateToURL( |
| 76 browser(), | 75 browser(), |
| 77 content::GetFileUrlWithQuery( | 76 content::GetFileUrlWithQuery( |
| 78 gpu_test_dir_.AppendASCII("webgl.html"), "query=kill")); | 77 gpu_test_dir_.AppendASCII("webgl.html"), "query=kill")); |
| 79 observer.Wait(); | 78 observer.Wait(); |
| 80 | 79 |
| 81 content::WindowedNotificationObserver infobar_added( | 80 content::WindowedNotificationObserver infobar_added( |
| 82 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 81 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
| 83 content::NotificationService::AllSources()); | 82 content::NotificationService::AllSources()); |
| 84 SimulateGPUCrash(browser()); | 83 SimulateGPUCrash(browser()); |
| 85 infobar_added.Wait(); | 84 infobar_added.Wait(); |
| 86 EXPECT_EQ(1u, | 85 EXPECT_EQ(1u, |
| 87 InfoBarService::FromWebContents( | 86 InfoBarService::FromWebContents( |
| 88 browser()->tab_strip_model()->GetActiveWebContents())-> | 87 browser()->tab_strip_model()->GetActiveWebContents())-> |
| 89 GetInfoBarCount()); | 88 GetInfoBarCount()); |
| 90 } | 89 } |
| 91 | 90 |
| 92 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossInfobarReload) { | 91 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossInfobarReload) { |
| 93 // crbug.com/162982, flaky on Mac Retina Release, timeout on Debug. | 92 if (GPUTestBotConfig::CurrentConfigMatches("XP")) |
| 94 if (GPUTestBotConfig::CurrentConfigMatches("MAC NVIDIA 0x0fd5")) | |
| 95 return; | 93 return; |
| 96 | 94 |
| 97 content::DOMMessageQueue message_queue; | 95 content::DOMMessageQueue message_queue; |
| 98 | 96 |
| 99 // Load page and wait for it to load. | 97 // Load page and wait for it to load. |
| 100 content::WindowedNotificationObserver observer( | 98 content::WindowedNotificationObserver observer( |
| 101 content::NOTIFICATION_LOAD_STOP, | 99 content::NOTIFICATION_LOAD_STOP, |
| 102 content::NotificationService::AllSources()); | 100 content::NotificationService::AllSources()); |
| 103 ui_test_utils::NavigateToURL( | 101 ui_test_utils::NavigateToURL( |
| 104 browser(), | 102 browser(), |
| (...skipping 27 matching lines...) Expand all Loading... |
| 132 // The page should reload and another message sent to the | 130 // The page should reload and another message sent to the |
| 133 // DomAutomationController. | 131 // DomAutomationController. |
| 134 m = ""; | 132 m = ""; |
| 135 ASSERT_TRUE(message_queue.WaitForMessage(&m)); | 133 ASSERT_TRUE(message_queue.WaitForMessage(&m)); |
| 136 EXPECT_EQ("\"LOADED\"", m); | 134 EXPECT_EQ("\"LOADED\"", m); |
| 137 } | 135 } |
| 138 | 136 |
| 139 // There isn't any point in adding a test which calls Accept() on the | 137 // There isn't any point in adding a test which calls Accept() on the |
| 140 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and | 138 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and |
| 141 // there's no concrete event that could be observed in response. | 139 // there's no concrete event that could be observed in response. |
| OLD | NEW |