OLD | NEW |
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/hash.h" | 6 #include "base/hash.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 string16 query = UTF8ToUTF16( | 115 string16 query = UTF8ToUTF16( |
116 std::string("xyzxyz" + base::IntToString(next_dummy_search_value_++))); | 116 std::string("xyzxyz" + base::IntToString(next_dummy_search_value_++))); |
117 ASSERT_EQ(0, ui_test_utils::FindInPage( | 117 ASSERT_EQ(0, ui_test_utils::FindInPage( |
118 browser()->tab_strip_model()->GetActiveWebContents(), | 118 browser()->tab_strip_model()->GetActiveWebContents(), |
119 query, true, false, NULL, NULL)); | 119 query, true, false, NULL, NULL)); |
120 } | 120 } |
121 | 121 |
122 private: | 122 private: |
123 void GetSnapshotFromRendererCallback(bool success, | 123 void GetSnapshotFromRendererCallback(bool success, |
124 const SkBitmap& bitmap) { | 124 const SkBitmap& bitmap) { |
125 MessageLoopForUI::current()->Quit(); | 125 base::MessageLoopForUI::current()->Quit(); |
126 ASSERT_EQ(success, true); | 126 ASSERT_EQ(success, true); |
127 base::FilePath reference = ui_test_utils::GetTestFilePath( | 127 base::FilePath reference = ui_test_utils::GetTestFilePath( |
128 GetPDFTestDir(), | 128 GetPDFTestDir(), |
129 base::FilePath().AppendASCII(expected_filename_)); | 129 base::FilePath().AppendASCII(expected_filename_)); |
130 base::PlatformFileInfo info; | 130 base::PlatformFileInfo info; |
131 ASSERT_TRUE(file_util::GetFileInfo(reference, &info)); | 131 ASSERT_TRUE(file_util::GetFileInfo(reference, &info)); |
132 int size = static_cast<size_t>(info.size); | 132 int size = static_cast<size_t>(info.size); |
133 scoped_ptr<char[]> data(new char[size]); | 133 scoped_ptr<char[]> data(new char[size]); |
134 ASSERT_EQ(size, file_util::ReadFile(reference, data.get(), size)); | 134 ASSERT_EQ(size, file_util::ReadFile(reference, data.get(), size)); |
135 | 135 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 browser()->tab_strip_model()->GetActiveWebContents(), | 411 browser()->tab_strip_model()->GetActiveWebContents(), |
412 "reloadPDF();")); | 412 "reloadPDF();")); |
413 observer.Wait(); | 413 observer.Wait(); |
414 | 414 |
415 ASSERT_EQ("success", | 415 ASSERT_EQ("success", |
416 browser()->tab_strip_model()->GetActiveWebContents()-> | 416 browser()->tab_strip_model()->GetActiveWebContents()-> |
417 GetURL().query()); | 417 GetURL().query()); |
418 } | 418 } |
419 | 419 |
420 } // namespace | 420 } // namespace |
OLD | NEW |