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