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" |
| 11 #include "chrome/browser/gpu_blacklist.h" |
11 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
15 #include "chrome/test/base/test_launcher_utils.h" | 16 #include "chrome/test/base/test_launcher_utils.h" |
16 #include "chrome/test/base/tracing.h" | 17 #include "chrome/test/base/tracing.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/gpu_data_manager.h" | 19 #include "content/public/browser/gpu_data_manager.h" |
19 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
20 #include "content/test/gpu/gpu_test_config.h" | 21 #include "content/test/gpu/gpu_test_config.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #endif | 60 #endif |
60 } else { | 61 } else { |
61 gpu_enabled_ = true; | 62 gpu_enabled_ = true; |
62 } | 63 } |
63 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 64 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
64 ui::DisableTestCompositor(); | 65 ui::DisableTestCompositor(); |
65 command_line->AppendSwitchASCII(switches::kWindowSize, "400,300"); | 66 command_line->AppendSwitchASCII(switches::kWindowSize, "400,300"); |
66 } | 67 } |
67 | 68 |
68 void SetupBlacklist(const std::string& json_blacklist) { | 69 void SetupBlacklist(const std::string& json_blacklist) { |
69 GpuDataManager::GetInstance()->Initialize("0", json_blacklist); | 70 GpuBlacklist* blacklist = GpuBlacklist::GetInstance(); |
| 71 ASSERT_TRUE(blacklist->LoadGpuBlacklist( |
| 72 json_blacklist, GpuBlacklist::kAllOs)); |
| 73 blacklist->UpdateGpuDataManager(); |
70 } | 74 } |
71 | 75 |
72 // If expected_reply is NULL, we don't check the reply content. | 76 // If expected_reply is NULL, we don't check the reply content. |
73 void RunTest(const FilePath& url, | 77 void RunTest(const FilePath& url, |
74 const char* expected_reply, | 78 const char* expected_reply, |
75 bool new_tab) { | 79 bool new_tab) { |
76 #if defined(OS_LINUX) && !defined(NDEBUG) | 80 #if defined(OS_LINUX) && !defined(NDEBUG) |
77 // Bypass tests on GPU Linux Debug bots. | 81 // Bypass tests on GPU Linux Debug bots. |
78 if (gpu_enabled_) | 82 if (gpu_enabled_) |
79 return; | 83 return; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 // indicate that the renderer is not simply spinning on RAF. | 419 // indicate that the renderer is not simply spinning on RAF. |
416 EXPECT_GT(stats.mean_us, 15000.0); | 420 EXPECT_GT(stats.mean_us, 15000.0); |
417 | 421 |
418 // Print out the trace events upon error to debug failures. | 422 // Print out the trace events upon error to debug failures. |
419 if (stats.mean_us <= 15000.0) { | 423 if (stats.mean_us <= 15000.0) { |
420 fprintf(stderr, "\n\nTRACE JSON:\n\n%s\n\n", trace_events_json_.c_str()); | 424 fprintf(stderr, "\n\nTRACE JSON:\n\n%s\n\n", trace_events_json_.c_str()); |
421 } | 425 } |
422 } | 426 } |
423 | 427 |
424 } // namespace anonymous | 428 } // namespace anonymous |
OLD | NEW |