OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string16.h" | 7 #include "base/string16.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 virtual void SetUpInProcessBrowserTestFixture() { | 27 virtual void SetUpInProcessBrowserTestFixture() { |
28 FilePath test_dir; | 28 FilePath test_dir; |
29 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); | 29 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
30 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 30 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
31 } | 31 } |
32 | 32 |
33 virtual void SetUpCommandLine(CommandLine* command_line) { | 33 virtual void SetUpCommandLine(CommandLine* command_line) { |
34 InProcessBrowserTest::SetUpCommandLine(command_line); | 34 InProcessBrowserTest::SetUpCommandLine(command_line); |
35 | 35 |
36 EXPECT_TRUE(test_launcher_utils::OverrideGLImplementation( | 36 // GPU tests require gpu acceleration. |
37 command_line, | 37 // We do not care which GL backend is used. |
38 gfx::kGLImplementationOSMesaName)); | 38 command_line->AppendSwitchASCII(switches::kUseGL, "any"); |
39 | 39 |
40 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 40 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
41 | |
42 #if defined(OS_MACOSX) | |
43 // Accelerated compositing does not work with OSMesa. AcceleratedSurface | |
44 // assumes GL contexts are native. | |
45 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | |
46 #endif | |
47 } | 41 } |
48 | 42 |
49 FilePath gpu_test_dir_; | 43 FilePath gpu_test_dir_; |
50 }; | 44 }; |
51 | 45 |
52 #if defined(TOOLKIT_VIEWS) | |
53 // Flaky on Windows (dbg): http://crbug.com/72608 | |
54 // For ChromeOS: http://crbug.com/76217 | |
55 #define MAYBE_BrowserTestCanLaunchWithOSMesa DISABLED_BrowserTestCanLaunchWithOS
Mesa | |
56 #else | |
57 #define MAYBE_BrowserTestCanLaunchWithOSMesa BrowserTestCanLaunchWithOSMesa | |
58 #endif | |
59 | |
60 IN_PROC_BROWSER_TEST_F(GPUBrowserTest, MAYBE_BrowserTestCanLaunchWithOSMesa) { | |
61 // Check the webgl test reports success and that the renderer was OSMesa. | |
62 ui_test_utils::NavigateToURL( | |
63 browser(), | |
64 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("webgl.html"))); | |
65 | |
66 EXPECT_EQ(ASCIIToUTF16("SUCCESS: WebKit WebGL"), | |
67 browser()->GetSelectedTabContents()->GetTitle()); | |
68 } | |
69 | |
70 // Test is flaky and timing out. See crbug.com/99883 | 46 // Test is flaky and timing out. See crbug.com/99883 |
71 IN_PROC_BROWSER_TEST_F(GPUBrowserTest, | 47 IN_PROC_BROWSER_TEST_F(GPUBrowserTest, |
72 DISABLED_CanOpenPopupAndRenderWithWebGLCanvas) { | 48 DISABLED_CanOpenPopupAndRenderWithWebGLCanvas) { |
73 ui_test_utils::DOMMessageQueue message_queue; | 49 ui_test_utils::DOMMessageQueue message_queue; |
74 | 50 |
75 ui_test_utils::NavigateToURL( | 51 ui_test_utils::NavigateToURL( |
76 browser(), | 52 browser(), |
77 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("webgl_popup.html"))); | 53 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("webgl_popup.html"))); |
78 | 54 |
79 std::string result; | 55 std::string result; |
80 ASSERT_TRUE(message_queue.WaitForMessage(&result)); | 56 ASSERT_TRUE(message_queue.WaitForMessage(&result)); |
81 EXPECT_EQ("\"SUCCESS\"", result); | 57 EXPECT_EQ("\"SUCCESS\"", result); |
82 } | 58 } |
83 | 59 |
84 IN_PROC_BROWSER_TEST_F(GPUBrowserTest, CanOpenPopupAndRenderWith2DCanvas) { | 60 IN_PROC_BROWSER_TEST_F(GPUBrowserTest, CanOpenPopupAndRenderWith2DCanvas) { |
85 ui_test_utils::DOMMessageQueue message_queue; | 61 ui_test_utils::DOMMessageQueue message_queue; |
86 | 62 |
87 ui_test_utils::NavigateToURL( | 63 ui_test_utils::NavigateToURL( |
88 browser(), | 64 browser(), |
89 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("canvas_popup.html"))); | 65 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("canvas_popup.html"))); |
90 | 66 |
91 std::string result; | 67 std::string result; |
92 ASSERT_TRUE(message_queue.WaitForMessage(&result)); | 68 ASSERT_TRUE(message_queue.WaitForMessage(&result)); |
93 EXPECT_EQ("\"SUCCESS\"", result); | 69 EXPECT_EQ("\"SUCCESS\"", result); |
94 } | 70 } |
OLD | NEW |