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

Side by Side Diff: chrome/browser/ui/pdf/pdf_browsertest_base.cc

Issue 593503003: Support error handling for Surface readbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted code and fixed build issue in test. Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/pdf/pdf_browsertest_base.h" 5 #include "chrome/browser/ui/pdf/pdf_browsertest_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 content::RunMessageLoop(); 105 content::RunMessageLoop();
106 106
107 if (snapshot_different_) { 107 if (snapshot_different_) {
108 LOG(INFO) << "Rendering didn't match, see result " 108 LOG(INFO) << "Rendering didn't match, see result "
109 << snapshot_filename_.value(); 109 << snapshot_filename_.value();
110 } 110 }
111 return !snapshot_different_; 111 return !snapshot_different_;
112 } 112 }
113 113
114 void PDFBrowserTest::CopyFromBackingStoreCallback(bool success, 114 void PDFBrowserTest::CopyFromBackingStoreCallback(
115 const SkBitmap& bitmap) { 115 const SkBitmap& bitmap,
116 content::ReadbackResponse response) {
116 base::MessageLoopForUI::current()->Quit(); 117 base::MessageLoopForUI::current()->Quit();
117 ASSERT_EQ(success, true); 118 ASSERT_EQ(response, content::READBACK_SUCCESS);
118 base::FilePath reference = ui_test_utils::GetTestFilePath( 119 base::FilePath reference = ui_test_utils::GetTestFilePath(
119 base::FilePath(FILE_PATH_LITERAL("pdf_private")), 120 base::FilePath(FILE_PATH_LITERAL("pdf_private")),
120 base::FilePath().AppendASCII(expected_filename_)); 121 base::FilePath().AppendASCII(expected_filename_));
121 base::File::Info info; 122 base::File::Info info;
122 ASSERT_TRUE(base::GetFileInfo(reference, &info)); 123 ASSERT_TRUE(base::GetFileInfo(reference, &info));
123 int size = static_cast<size_t>(info.size); 124 int size = static_cast<size_t>(info.size);
124 scoped_ptr<char[]> data(new char[size]); 125 scoped_ptr<char[]> data(new char[size]);
125 ASSERT_EQ(size, base::ReadFile(reference, data.get(), size)); 126 ASSERT_EQ(size, base::ReadFile(reference, data.get(), size));
126 127
127 int w, h; 128 int w, h;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Calling RenderWidgetHost::CopyFromBackingStore() with the GPU enabled 189 // Calling RenderWidgetHost::CopyFromBackingStore() with the GPU enabled
189 // fails on Linux. 190 // fails on Linux.
190 command_line->AppendSwitch(switches::kDisableGpu); 191 command_line->AppendSwitch(switches::kDisableGpu);
191 #endif 192 #endif
192 193
193 #if defined(OS_CHROMEOS) 194 #if defined(OS_CHROMEOS)
194 // Also need on CrOS in addition to disabling the GPU above. 195 // Also need on CrOS in addition to disabling the GPU above.
195 command_line->AppendSwitch(switches::kUIDisableThreadedCompositing); 196 command_line->AppendSwitch(switches::kUIDisableThreadedCompositing);
196 #endif 197 #endif
197 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698