| 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/files/file_enumerator.h" | |
| 7 #include "base/hash.h" | 6 #include "base/hash.h" |
| 8 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 ASSERT_TRUE(pdf_test_server()->Start()); | 307 ASSERT_TRUE(pdf_test_server()->Start()); |
| 309 | 308 |
| 310 NavigationController* controller = | 309 NavigationController* controller = |
| 311 &(browser()->tab_strip_model()->GetActiveWebContents()->GetController()); | 310 &(browser()->tab_strip_model()->GetActiveWebContents()->GetController()); |
| 312 content::NotificationRegistrar registrar; | 311 content::NotificationRegistrar registrar; |
| 313 registrar.Add(this, | 312 registrar.Add(this, |
| 314 content::NOTIFICATION_LOAD_STOP, | 313 content::NOTIFICATION_LOAD_STOP, |
| 315 content::Source<NavigationController>(controller)); | 314 content::Source<NavigationController>(controller)); |
| 316 std::string base_url = std::string("files/"); | 315 std::string base_url = std::string("files/"); |
| 317 | 316 |
| 318 base::FileEnumerator file_enumerator( | 317 file_util::FileEnumerator file_enumerator( |
| 319 ui_test_utils::GetTestFilePath(GetPDFTestDir(), base::FilePath()), | 318 ui_test_utils::GetTestFilePath(GetPDFTestDir(), base::FilePath()), |
| 320 false, | 319 false, |
| 321 base::FileEnumerator::FILES, | 320 file_util::FileEnumerator::FILES, |
| 322 FILE_PATH_LITERAL("*.pdf")); | 321 FILE_PATH_LITERAL("*.pdf")); |
| 323 for (base::FilePath file_path = file_enumerator.Next(); | 322 for (base::FilePath file_path = file_enumerator.Next(); |
| 324 !file_path.empty(); | 323 !file_path.empty(); |
| 325 file_path = file_enumerator.Next()) { | 324 file_path = file_enumerator.Next()) { |
| 326 std::string filename = file_path.BaseName().MaybeAsASCII(); | 325 std::string filename = file_path.BaseName().MaybeAsASCII(); |
| 327 ASSERT_FALSE(filename.empty()); | 326 ASSERT_FALSE(filename.empty()); |
| 328 | 327 |
| 329 #if defined(OS_POSIX) | 328 #if defined(OS_POSIX) |
| 330 if (filename == "sample.pdf") | 329 if (filename == "sample.pdf") |
| 331 continue; // Crashes on Mac and Linux. http://crbug.com/63549 | 330 continue; // Crashes on Mac and Linux. http://crbug.com/63549 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 browser()->tab_strip_model()->GetActiveWebContents(), | 411 browser()->tab_strip_model()->GetActiveWebContents(), |
| 413 "reloadPDF();")); | 412 "reloadPDF();")); |
| 414 observer.Wait(); | 413 observer.Wait(); |
| 415 | 414 |
| 416 ASSERT_EQ("success", | 415 ASSERT_EQ("success", |
| 417 browser()->tab_strip_model()->GetActiveWebContents()-> | 416 browser()->tab_strip_model()->GetActiveWebContents()-> |
| 418 GetURL().query()); | 417 GetURL().query()); |
| 419 } | 418 } |
| 420 | 419 |
| 421 } // namespace | 420 } // namespace |
| OLD | NEW |