OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |