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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 55 // GPU tests require gpu acceleration. |
| 56 #if !defined(OS_MACOSX) |
| 57 command_line->AppendSwitchASCII( |
| 58 switches::kUseGL, gfx::kGLImplementationOSMesaName); |
| 59 #endif |
| 60 } |
54 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 61 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
55 base::FilePath test_dir; | 62 base::FilePath test_dir; |
56 ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); | 63 ASSERT_TRUE(PathService::Get(content::DIR_TEST_DATA, &test_dir)); |
57 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 64 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
58 } | 65 } |
59 base::FilePath gpu_test_dir_; | 66 base::FilePath gpu_test_dir_; |
60 }; | 67 }; |
61 | 68 |
62 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { | 69 IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { |
63 #if defined(OS_WIN) && defined(USE_ASH) | 70 #if defined(OS_WIN) && defined(USE_ASH) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // The page should reload and another message sent to the | 141 // The page should reload and another message sent to the |
135 // DomAutomationController. | 142 // DomAutomationController. |
136 m.clear(); | 143 m.clear(); |
137 ASSERT_TRUE(message_queue.WaitForMessage(&m)); | 144 ASSERT_TRUE(message_queue.WaitForMessage(&m)); |
138 EXPECT_EQ("\"LOADED\"", m); | 145 EXPECT_EQ("\"LOADED\"", m); |
139 } | 146 } |
140 | 147 |
141 // There isn't any point in adding a test which calls Accept() on the | 148 // There isn't any point in adding a test which calls Accept() on the |
142 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and | 149 // ThreeDAPIInfoBarDelegate; doing so doesn't remove the infobar, and |
143 // there's no concrete event that could be observed in response. | 150 // there's no concrete event that could be observed in response. |
OLD | NEW |