Chromium Code Reviews| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/test/trace_event_analyzer.h" | 8 #include "base/test/trace_event_analyzer.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 | 195 |
| 196 // The printed result will be the average time between frames in the | 196 // The printed result will be the average time between frames in the |
| 197 // browser window. | 197 // browser window. |
| 198 bool gpu_frames = PrintResults( | 198 bool gpu_frames = PrintResults( |
| 199 analyzer.get(), | 199 analyzer.get(), |
| 200 test_name, | 200 test_name, |
| 201 "RenderWidget::didCommitAndDrawCompositorFrame", | 201 "RenderWidget::didCommitAndDrawCompositorFrame", |
| 202 "ms"); | 202 "ms"); |
| 203 EXPECT_TRUE(gpu_frames); | 203 EXPECT_TRUE(gpu_frames); |
| 204 | 204 |
| 205 // This prints out the average time between capture events. | 205 // This prints out the average time between capture events. As the capture |
| 206 // As the capture frame rate is capped at 30fps, this score | 206 // frame rate is capped at 30fps, this score cannot get any better than |
| 207 // cannot get any better than (lower) 33.33 ms. | 207 // (lower) 33.33 ms. Note that we track the CaptureSucceeded event rather |
| 208 // than Capture, as Capture only indicates that a capture was requested. | |
| 208 EXPECT_TRUE(PrintResults(analyzer.get(), | 209 EXPECT_TRUE(PrintResults(analyzer.get(), |
| 209 test_name, | 210 test_name, |
| 210 "Capture", | 211 "CaptureSucceeded", |
|
hubbe
2015/05/19 19:14:52
How about printing out both results?
(Add a TODO t
ericrk
2015/05/19 20:02:08
Good call - done.
| |
| 211 "ms")); | 212 "ms")); |
| 212 } | 213 } |
| 213 }; | 214 }; |
| 214 | 215 |
| 215 } // namespace | 216 } // namespace |
| 216 | 217 |
| 217 IN_PROC_BROWSER_TEST_P(TabCapturePerformanceTest, Performance) { | 218 IN_PROC_BROWSER_TEST_P(TabCapturePerformanceTest, Performance) { |
| 218 RunTest("TabCapturePerformance"); | 219 RunTest("TabCapturePerformance"); |
| 219 } | 220 } |
| 220 | 221 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 247 TabCapturePerformanceTest, | 248 TabCapturePerformanceTest, |
| 248 testing::Values( | 249 testing::Values( |
| 249 kScalingTestBase | kScaleQualityFast, | 250 kScalingTestBase | kScaleQualityFast, |
| 250 kScalingTestBase | kScaleQualityGood, | 251 kScalingTestBase | kScaleQualityGood, |
| 251 kScalingTestBase | kScaleQualityBest, | 252 kScalingTestBase | kScaleQualityBest, |
| 252 kScalingTestBase | kScaleQualityFast | kSmallWindow, | 253 kScalingTestBase | kScaleQualityFast | kSmallWindow, |
| 253 kScalingTestBase | kScaleQualityGood | kSmallWindow, | 254 kScalingTestBase | kScaleQualityGood | kSmallWindow, |
| 254 kScalingTestBase | kScaleQualityBest | kSmallWindow)); | 255 kScalingTestBase | kScaleQualityBest | kSmallWindow)); |
| 255 | 256 |
| 256 #endif // USE_AURA | 257 #endif // USE_AURA |
| OLD | NEW |