Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc

Issue 120313002: Use stub GL draw/clear calls for browser tests that do not need pixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stubgl: use_osmesa Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #if defined(OS_MACOSX) 7 #if defined(OS_MACOSX)
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #endif 9 #endif
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 suffix += "_novsync"; 92 suffix += "_novsync";
93 if (HasFlag(kTestThroughWebRTC)) 93 if (HasFlag(kTestThroughWebRTC))
94 suffix += "_webrtc"; 94 suffix += "_webrtc";
95 if (!ScalingMethod().empty()) 95 if (!ScalingMethod().empty())
96 suffix += "_scale" + ScalingMethod(); 96 suffix += "_scale" + ScalingMethod();
97 if (HasFlag(kSmallWindow)) 97 if (HasFlag(kSmallWindow))
98 suffix += "_small"; 98 suffix += "_small";
99 return suffix; 99 return suffix;
100 } 100 }
101 101
102 virtual void SetUp() OVERRIDE {
103 // These tests needs pixel results.
104 UseRealGLContexts();
105 ExtensionApiTest::SetUp();
106 }
107
102 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 108 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
103 if (!ScalingMethod().empty()) { 109 if (!ScalingMethod().empty()) {
104 command_line->AppendSwitchASCII(switches::kTabCaptureUpscaleQuality, 110 command_line->AppendSwitchASCII(switches::kTabCaptureUpscaleQuality,
105 ScalingMethod()); 111 ScalingMethod());
106 command_line->AppendSwitchASCII(switches::kTabCaptureDownscaleQuality, 112 command_line->AppendSwitchASCII(switches::kTabCaptureDownscaleQuality,
107 ScalingMethod()); 113 ScalingMethod());
108 } 114 }
109 115
110 // UI tests boot up render views starting from about:blank. This causes 116 // UI tests boot up render views starting from about:blank. This causes
111 // the renderer to start up thinking it cannot use the GPU. To work 117 // the renderer to start up thinking it cannot use the GPU. To work
112 // around that, and allow the frame rate test to use the GPU, we must 118 // around that, and allow the frame rate test to use the GPU, we must
113 // pass kAllowWebUICompositing. 119 // pass kAllowWebUICompositing.
114 command_line->AppendSwitch(switches::kAllowWebUICompositing); 120 command_line->AppendSwitch(switches::kAllowWebUICompositing);
115 121
116 // Some of the tests may launch http requests through JSON or AJAX 122 // Some of the tests may launch http requests through JSON or AJAX
117 // which causes a security error (cross domain request) when the page 123 // which causes a security error (cross domain request) when the page
118 // is loaded from the local file system ( file:// ). The following switch 124 // is loaded from the local file system ( file:// ). The following switch
119 // fixes that error. 125 // fixes that error.
120 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); 126 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
121 127
122 if (HasFlag(kSmallWindow)) { 128 if (HasFlag(kSmallWindow)) {
123 command_line->AppendSwitchASCII(switches::kWindowSize, "800,600"); 129 command_line->AppendSwitchASCII(switches::kWindowSize, "800,600");
124 } else { 130 } else {
125 command_line->AppendSwitchASCII(switches::kWindowSize, "2000,1500"); 131 command_line->AppendSwitchASCII(switches::kWindowSize, "2000,1500");
126 } 132 }
127 133
128 UseRealGLContexts();
129
130 if (!HasFlag(kUseGpu)) { 134 if (!HasFlag(kUseGpu)) {
131 command_line->AppendSwitch(switches::kDisableGpu); 135 command_line->AppendSwitch(switches::kDisableGpu);
132 } else { 136 } else {
133 command_line->AppendSwitch(switches::kForceCompositingMode); 137 command_line->AppendSwitch(switches::kForceCompositingMode);
134 } 138 }
135 139
136 if (HasFlag(kDisableVsync)) 140 if (HasFlag(kDisableVsync))
137 command_line->AppendSwitch(switches::kDisableGpuVsync); 141 command_line->AppendSwitch(switches::kDisableGpuVsync);
138 142
139 command_line->AppendSwitchASCII(switches::kWhitelistedExtensionID, 143 command_line->AppendSwitchASCII(switches::kWhitelistedExtensionID,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 TabCapturePerformanceTest, 263 TabCapturePerformanceTest,
260 testing::Values( 264 testing::Values(
261 kScalingTestBase | kScaleQualityFast, 265 kScalingTestBase | kScaleQualityFast,
262 kScalingTestBase | kScaleQualityGood, 266 kScalingTestBase | kScaleQualityGood,
263 kScalingTestBase | kScaleQualityBest, 267 kScalingTestBase | kScaleQualityBest,
264 kScalingTestBase | kScaleQualityFast | kSmallWindow, 268 kScalingTestBase | kScaleQualityFast | kSmallWindow,
265 kScalingTestBase | kScaleQualityGood | kSmallWindow, 269 kScalingTestBase | kScaleQualityGood | kSmallWindow,
266 kScalingTestBase | kScaleQualityBest | kSmallWindow)); 270 kScalingTestBase | kScaleQualityBest | kSmallWindow));
267 271
268 #endif // USE_AURA 272 #endif // USE_AURA
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc ('k') | chrome/browser/extensions/cast_streaming_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698