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

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

Issue 2047533002: [tracing] Add browser test for background memory tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@set_whitelist
Patch Set: Remove single proc tests. Created 4 years, 6 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
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/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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 void RunTest(const std::string& test_name) { 145 void RunTest(const std::string& test_name) {
146 if (HasFlag(kUseGpu) && !IsGpuAvailable()) { 146 if (HasFlag(kUseGpu) && !IsGpuAvailable()) {
147 LOG(WARNING) << 147 LOG(WARNING) <<
148 "Test skipped: requires gpu. Pass --enable-gpu on the command " 148 "Test skipped: requires gpu. Pass --enable-gpu on the command "
149 "line if use of GPU is desired."; 149 "line if use of GPU is desired.";
150 return; 150 return;
151 } 151 }
152 152
153 std::string json_events; 153 std::string json_events;
154 ASSERT_TRUE(tracing::BeginTracing("gpu,gpu.capture")); 154 ASSERT_TRUE(tracing::BeginTracing(
155 base::trace_event::TraceConfig("gpu,gpu.capture", "")));
155 std::string page = "performance.html"; 156 std::string page = "performance.html";
156 page += HasFlag(kTestThroughWebRTC) ? "?WebRTC=1" : "?WebRTC=0"; 157 page += HasFlag(kTestThroughWebRTC) ? "?WebRTC=1" : "?WebRTC=0";
157 // Ideally we'd like to run a higher capture rate when vsync is disabled, 158 // Ideally we'd like to run a higher capture rate when vsync is disabled,
158 // but libjingle currently doesn't allow that. 159 // but libjingle currently doesn't allow that.
159 // page += HasFlag(kDisableVsync) ? "&fps=300" : "&fps=30"; 160 // page += HasFlag(kDisableVsync) ? "&fps=300" : "&fps=30";
160 page += "&fps=60"; 161 page += "&fps=60";
161 ASSERT_TRUE(RunExtensionSubtest("tab_capture", page)) << message_; 162 ASSERT_TRUE(RunExtensionSubtest("tab_capture", page)) << message_;
162 ASSERT_TRUE(tracing::EndTracing(&json_events)); 163 ASSERT_TRUE(tracing::EndTracing(&json_events));
163 std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer; 164 std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer;
164 analyzer.reset(trace_analyzer::TraceAnalyzer::Create(json_events)); 165 analyzer.reset(trace_analyzer::TraceAnalyzer::Create(json_events));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 testing::Values( 205 testing::Values(
205 0, 206 0,
206 kUseGpu | kForceGpuComposited, 207 kUseGpu | kForceGpuComposited,
207 kDisableVsync, 208 kDisableVsync,
208 kDisableVsync | kUseGpu | kForceGpuComposited, 209 kDisableVsync | kUseGpu | kForceGpuComposited,
209 kTestThroughWebRTC, 210 kTestThroughWebRTC,
210 kTestThroughWebRTC | kUseGpu | kForceGpuComposited, 211 kTestThroughWebRTC | kUseGpu | kForceGpuComposited,
211 kTestThroughWebRTC | kDisableVsync, 212 kTestThroughWebRTC | kDisableVsync,
212 kTestThroughWebRTC | kDisableVsync | kUseGpu | kForceGpuComposited)); 213 kTestThroughWebRTC | kDisableVsync | kUseGpu | kForceGpuComposited));
213 214
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698