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/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/test/trace_event_analyzer.h" | 9 #include "base/test/trace_event_analyzer.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 public: | 44 public: |
45 GpuFeatureTest() : trace_categories_("test_gpu"), gpu_enabled_(false) {} | 45 GpuFeatureTest() : trace_categories_("test_gpu"), gpu_enabled_(false) {} |
46 | 46 |
47 virtual void SetUpInProcessBrowserTestFixture() { | 47 virtual void SetUpInProcessBrowserTestFixture() { |
48 FilePath test_dir; | 48 FilePath test_dir; |
49 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); | 49 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
50 gpu_test_dir_ = test_dir.AppendASCII("gpu"); | 50 gpu_test_dir_ = test_dir.AppendASCII("gpu"); |
51 } | 51 } |
52 | 52 |
53 virtual void SetUpCommandLine(CommandLine* command_line) { | 53 virtual void SetUpCommandLine(CommandLine* command_line) { |
54 // This enables DOM automation for tab contents. | |
55 EnableDOMAutomation(); | |
56 | |
57 InProcessBrowserTest::SetUpCommandLine(command_line); | |
58 | |
59 // Do not use mesa if real GPU is required. | 54 // Do not use mesa if real GPU is required. |
60 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { | 55 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { |
61 #if !defined(OS_MACOSX) | 56 #if !defined(OS_MACOSX) |
62 CHECK(test_launcher_utils::OverrideGLImplementation( | 57 CHECK(test_launcher_utils::OverrideGLImplementation( |
63 command_line, gfx::kGLImplementationOSMesaName)) << | 58 command_line, gfx::kGLImplementationOSMesaName)) << |
64 "kUseGL must not be set by test framework code!"; | 59 "kUseGL must not be set by test framework code!"; |
65 #endif | 60 #endif |
66 } else { | 61 } else { |
67 gpu_enabled_ = true; | 62 gpu_enabled_ = true; |
68 } | 63 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // indicate that the renderer is not simply spinning on RAF. | 408 // indicate that the renderer is not simply spinning on RAF. |
414 EXPECT_GT(stats.mean_us, 15000.0); | 409 EXPECT_GT(stats.mean_us, 15000.0); |
415 | 410 |
416 // Print out the trace events upon error to debug failures. | 411 // Print out the trace events upon error to debug failures. |
417 if (stats.mean_us <= 15000.0) { | 412 if (stats.mean_us <= 15000.0) { |
418 fprintf(stderr, "\n\nTRACE JSON:\n\n%s\n\n", trace_events_json_.c_str()); | 413 fprintf(stderr, "\n\nTRACE JSON:\n\n%s\n\n", trace_events_json_.c_str()); |
419 } | 414 } |
420 } | 415 } |
421 | 416 |
422 } // namespace anonymous | 417 } // namespace anonymous |
OLD | NEW |