| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/test/trace_event_analyzer.h" | 7 #include "base/test/trace_event_analyzer.h" |
| 8 #include "base/win/windows_version.h" | 8 #include "base/win/windows_version.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 std::string json_events; | 153 std::string json_events; |
| 154 ASSERT_TRUE(tracing::BeginTracing("gpu,gpu.capture")); | 154 ASSERT_TRUE(tracing::BeginTracing("gpu,gpu.capture")); |
| 155 std::string page = "performance.html"; | 155 std::string page = "performance.html"; |
| 156 page += HasFlag(kTestThroughWebRTC) ? "?WebRTC=1" : "?WebRTC=0"; | 156 page += HasFlag(kTestThroughWebRTC) ? "?WebRTC=1" : "?WebRTC=0"; |
| 157 // Ideally we'd like to run a higher capture rate when vsync is disabled, | 157 // Ideally we'd like to run a higher capture rate when vsync is disabled, |
| 158 // but libjingle currently doesn't allow that. | 158 // but libjingle currently doesn't allow that. |
| 159 // page += HasFlag(kDisableVsync) ? "&fps=300" : "&fps=30"; | 159 // page += HasFlag(kDisableVsync) ? "&fps=300" : "&fps=30"; |
| 160 page += "&fps=60"; | 160 page += "&fps=60"; |
| 161 ASSERT_TRUE(RunExtensionSubtest("tab_capture", page)) << message_; | 161 ASSERT_TRUE(RunExtensionSubtest("tab_capture", page)) << message_; |
| 162 ASSERT_TRUE(tracing::EndTracing(&json_events)); | 162 ASSERT_TRUE(tracing::EndTracing(&json_events)); |
| 163 scoped_ptr<trace_analyzer::TraceAnalyzer> analyzer; | 163 std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer; |
| 164 analyzer.reset(trace_analyzer::TraceAnalyzer::Create(json_events)); | 164 analyzer.reset(trace_analyzer::TraceAnalyzer::Create(json_events)); |
| 165 | 165 |
| 166 // The printed result will be the average time between frames in the | 166 // The printed result will be the average time between frames in the |
| 167 // browser window. | 167 // browser window. |
| 168 bool gpu_frames = PrintResults( | 168 bool gpu_frames = PrintResults( |
| 169 analyzer.get(), | 169 analyzer.get(), |
| 170 test_name, | 170 test_name, |
| 171 "RenderWidget::DidCommitAndDrawCompositorFrame", | 171 "RenderWidget::DidCommitAndDrawCompositorFrame", |
| 172 "ms"); | 172 "ms"); |
| 173 EXPECT_TRUE(gpu_frames); | 173 EXPECT_TRUE(gpu_frames); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 204 testing::Values( | 204 testing::Values( |
| 205 0, | 205 0, |
| 206 kUseGpu | kForceGpuComposited, | 206 kUseGpu | kForceGpuComposited, |
| 207 kDisableVsync, | 207 kDisableVsync, |
| 208 kDisableVsync | kUseGpu | kForceGpuComposited, | 208 kDisableVsync | kUseGpu | kForceGpuComposited, |
| 209 kTestThroughWebRTC, | 209 kTestThroughWebRTC, |
| 210 kTestThroughWebRTC | kUseGpu | kForceGpuComposited, | 210 kTestThroughWebRTC | kUseGpu | kForceGpuComposited, |
| 211 kTestThroughWebRTC | kDisableVsync, | 211 kTestThroughWebRTC | kDisableVsync, |
| 212 kTestThroughWebRTC | kDisableVsync | kUseGpu | kForceGpuComposited)); | 212 kTestThroughWebRTC | kDisableVsync | kUseGpu | kForceGpuComposited)); |
| 213 | 213 |
| OLD | NEW |