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

Side by Side Diff: chrome/test/perf/rendering/throughput_tests.cc

Issue 10692110: screenshot disabling policy (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments (4) Created 8 years, 5 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 (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_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 gfx::Rect tab_contents_bounds; 213 gfx::Rect tab_contents_bounds;
214 chrome::GetActiveWebContents(browser())->GetContainerBounds( 214 chrome::GetActiveWebContents(browser())->GetContainerBounds(
215 &tab_contents_bounds); 215 &tab_contents_bounds);
216 216
217 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), 217 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(),
218 tab_contents_bounds.y() - root_bounds.y(), 218 tab_contents_bounds.y() - root_bounds.y(),
219 tab_contents_bounds.width(), 219 tab_contents_bounds.width(),
220 tab_contents_bounds.height()); 220 tab_contents_bounds.height());
221 221
222 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); 222 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow();
223 if (!browser::GrabWindowSnapshot(native_window, &png, snapshot_bounds)) { 223 if (!browser::GrabWindowSnapshotIfPermitted(native_window, &png,
224 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; 224 snapshot_bounds)) {
225 LOG(ERROR) << "browser::GrabWindowSnapshotIfPermitted() failed";
225 return false; 226 return false;
226 } 227 }
227 228
228 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), 229 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()),
229 png.size(), bitmap)) { 230 png.size(), bitmap)) {
230 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; 231 LOG(ERROR) << "Decode PNG to a SkBitmap failed";
231 return false; 232 return false;
232 } 233 }
233 return true; 234 return true;
234 } 235 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 553
553 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { 554 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) {
554 RunCanvasBenchTest("many_images", kNone); 555 RunCanvasBenchTest("many_images", kNone);
555 } 556 }
556 557
557 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { 558 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) {
558 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); 559 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest);
559 } 560 }
560 561
561 } // namespace 562 } // namespace
OLDNEW
« chrome/test/base/ui_test_utils_win.cc ('K') | « chrome/test/gpu/gpu_pixel_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698