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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 GURL(content::kChromeUIGpuCrashURL), | 42 GURL(content::kChromeUIGpuCrashURL), |
43 static_cast<content::PageTransition>( | 43 static_cast<content::PageTransition>( |
44 content::PAGE_TRANSITION_TYPED | | 44 content::PAGE_TRANSITION_TYPED | |
45 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)); | 45 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)); |
46 params.disposition = NEW_BACKGROUND_TAB; | 46 params.disposition = NEW_BACKGROUND_TAB; |
47 chrome::Navigate(¶ms); | 47 chrome::Navigate(¶ms); |
48 } | 48 } |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 class WebGLInfobarTest : public InProcessBrowserTest { | 52 class WebGLInfoBarTest : public InProcessBrowserTest { |
53 protected: | 53 protected: |
54 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 54 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
55 base::FilePath test_dir; | 55 base::FilePath test_dir; |
56 ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); | 56 ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); |
57 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 57 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
58 } | 58 } |
59 base::FilePath gpu_test_dir_; | 59 base::FilePath gpu_test_dir_; |
60 }; | 60 }; |
61 | 61 |
62 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { | 62 IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, ContextLossRaisesInfoBar) { |
63 #if defined(OS_WIN) && defined(USE_ASH) | 63 #if defined(OS_WIN) && defined(USE_ASH) |
64 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 64 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
65 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 65 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
66 return; | 66 return; |
67 #endif | 67 #endif |
68 | 68 |
69 if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) | 69 if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) |
70 return; | 70 return; |
71 | 71 |
72 // Load page and wait for it to load. | 72 // Load page and wait for it to load. |
(...skipping 10 matching lines...) Expand all Loading... |
83 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 83 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
84 content::NotificationService::AllSources()); | 84 content::NotificationService::AllSources()); |
85 SimulateGPUCrash(browser()); | 85 SimulateGPUCrash(browser()); |
86 infobar_added.Wait(); | 86 infobar_added.Wait(); |
87 EXPECT_EQ(1u, | 87 EXPECT_EQ(1u, |
88 InfoBarService::FromWebContents( | 88 InfoBarService::FromWebContents( |
89 browser()->tab_strip_model()->GetActiveWebContents())-> | 89 browser()->tab_strip_model()->GetActiveWebContents())-> |
90 infobar_count()); | 90 infobar_count()); |
91 } | 91 } |
92 | 92 |
93 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossInfobarReload) { | 93 IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, ContextLossInfoBarReload) { |
94 #if defined(OS_WIN) && defined(USE_ASH) | 94 #if defined(OS_WIN) && defined(USE_ASH) |
95 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 95 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
96 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 96 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
97 return; | 97 return; |
98 #endif | 98 #endif |
99 | 99 |
100 if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) | 100 if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) |
101 return; | 101 return; |
102 | 102 |
103 content::DOMMessageQueue message_queue; | 103 content::DOMMessageQueue message_queue; |
(...skipping 30 matching lines...) Expand all Loading... |
134 // The page should reload and another message sent to the | 134 // The page should reload and another message sent to the |
135 // DomAutomationController. | 135 // DomAutomationController. |
136 m.clear(); | 136 m.clear(); |
137 ASSERT_TRUE(message_queue.WaitForMessage(&m)); | 137 ASSERT_TRUE(message_queue.WaitForMessage(&m)); |
138 EXPECT_EQ("\"LOADED\"", m); | 138 EXPECT_EQ("\"LOADED\"", m); |
139 } | 139 } |
140 | 140 |
141 // There isn't any point in adding a test which calls Accept() on the | 141 // There isn't any point in adding a test which calls Accept() on the |
142 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and | 142 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and |
143 // there's no concrete event that could be observed in response. | 143 // there's no concrete event that could be observed in response. |
OLD | NEW |