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" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/base/test_launcher_utils.h" | |
15 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
16 #include "content/browser/tab_contents/tab_contents.h" | 15 #include "content/browser/tab_contents/tab_contents.h" |
17 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
18 #include "net/base/net_util.h" | 17 #include "net/base/net_util.h" |
19 #include "ui/gfx/gl/gl_implementation.h" | |
20 | 18 |
21 class GPUBrowserTest : public InProcessBrowserTest { | 19 class GPUBrowserTest : public InProcessBrowserTest { |
22 protected: | 20 protected: |
23 GPUBrowserTest() { | 21 GPUBrowserTest() { |
24 EnableDOMAutomation(); | 22 EnableDOMAutomation(); |
25 } | 23 } |
26 | 24 |
27 virtual void SetUpInProcessBrowserTestFixture() { | 25 virtual void SetUpInProcessBrowserTestFixture() { |
28 FilePath test_dir; | 26 FilePath test_dir; |
29 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); | 27 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
30 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 28 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
31 } | 29 } |
32 | 30 |
33 virtual void SetUpCommandLine(CommandLine* command_line) { | 31 virtual void SetUpCommandLine(CommandLine* command_line) { |
34 InProcessBrowserTest::SetUpCommandLine(command_line); | 32 InProcessBrowserTest::SetUpCommandLine(command_line); |
35 | 33 |
36 EXPECT_TRUE(test_launcher_utils::OverrideGLImplementation( | |
37 command_line, | |
38 gfx::kGLImplementationOSMesaName)); | |
39 | |
40 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 34 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
41 | 35 |
42 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
43 // Accelerated compositing does not work with OSMesa. AcceleratedSurface | 37 // Accelerated compositing does not work with OSMesa. AcceleratedSurface |
44 // assumes GL contexts are native. | 38 // assumes GL contexts are native. |
45 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 39 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
46 #endif | 40 #endif |
47 } | 41 } |
48 | 42 |
49 FilePath gpu_test_dir_; | 43 FilePath gpu_test_dir_; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ui_test_utils::DOMMessageQueue message_queue; | 79 ui_test_utils::DOMMessageQueue message_queue; |
86 | 80 |
87 ui_test_utils::NavigateToURL( | 81 ui_test_utils::NavigateToURL( |
88 browser(), | 82 browser(), |
89 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("canvas_popup.html"))); | 83 net::FilePathToFileURL(gpu_test_dir_.AppendASCII("canvas_popup.html"))); |
90 | 84 |
91 std::string result; | 85 std::string result; |
92 ASSERT_TRUE(message_queue.WaitForMessage(&result)); | 86 ASSERT_TRUE(message_queue.WaitForMessage(&result)); |
93 EXPECT_EQ("\"SUCCESS\"", result); | 87 EXPECT_EQ("\"SUCCESS\"", result); |
94 } | 88 } |
OLD | NEW |