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

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

Issue 125973003: [Buildfix] Fix PlatformFileInfo usage in pdf_browsertest.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/files/file.h"
6 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
7 #include "base/hash.h" 8 #include "base/hash.h"
8 #include "base/path_service.h" 9 #include "base/path_service.h"
9 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
11 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_window.h" 15 #include "chrome/browser/ui/browser_window.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 16 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 123 }
123 124
124 private: 125 private:
125 void GetSnapshotFromRendererCallback(bool success, 126 void GetSnapshotFromRendererCallback(bool success,
126 const SkBitmap& bitmap) { 127 const SkBitmap& bitmap) {
127 base::MessageLoopForUI::current()->Quit(); 128 base::MessageLoopForUI::current()->Quit();
128 ASSERT_EQ(success, true); 129 ASSERT_EQ(success, true);
129 base::FilePath reference = ui_test_utils::GetTestFilePath( 130 base::FilePath reference = ui_test_utils::GetTestFilePath(
130 GetPDFTestDir(), 131 GetPDFTestDir(),
131 base::FilePath().AppendASCII(expected_filename_)); 132 base::FilePath().AppendASCII(expected_filename_));
132 base::PlatformFileInfo info; 133 base::File::Info info;
133 ASSERT_TRUE(base::GetFileInfo(reference, &info)); 134 ASSERT_TRUE(base::GetFileInfo(reference, &info));
134 int size = static_cast<size_t>(info.size); 135 int size = static_cast<size_t>(info.size);
135 scoped_ptr<char[]> data(new char[size]); 136 scoped_ptr<char[]> data(new char[size]);
136 ASSERT_EQ(size, base::ReadFile(reference, data.get(), size)); 137 ASSERT_EQ(size, base::ReadFile(reference, data.get(), size));
137 138
138 int w, h; 139 int w, h;
139 std::vector<unsigned char> decoded; 140 std::vector<unsigned char> decoded;
140 ASSERT_TRUE(gfx::PNGCodec::Decode( 141 ASSERT_TRUE(gfx::PNGCodec::Decode(
141 reinterpret_cast<unsigned char*>(data.get()), size, 142 reinterpret_cast<unsigned char*>(data.get()), size,
142 gfx::PNGCodec::FORMAT_BGRA, &decoded, &w, &h)); 143 gfx::PNGCodec::FORMAT_BGRA, &decoded, &w, &h));
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 browser()->tab_strip_model()->GetActiveWebContents(), 418 browser()->tab_strip_model()->GetActiveWebContents(),
418 "reloadPDF();")); 419 "reloadPDF();"));
419 observer.Wait(); 420 observer.Wait();
420 421
421 ASSERT_EQ("success", 422 ASSERT_EQ("success",
422 browser()->tab_strip_model()->GetActiveWebContents()-> 423 browser()->tab_strip_model()->GetActiveWebContents()->
423 GetURL().query()); 424 GetURL().query());
424 } 425 }
425 426
426 } // namespace 427 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698