| 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" | 6 #include "base/files/file_enumerator.h" |
| 7 #include "base/hash.h" | 7 #include "base/hash.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 static const int kBrowserHeight = 600; | 38 static const int kBrowserHeight = 600; |
| 39 | 39 |
| 40 class PDFBrowserTest : public InProcessBrowserTest, | 40 class PDFBrowserTest : public InProcessBrowserTest, |
| 41 public testing::WithParamInterface<int>, | 41 public testing::WithParamInterface<int>, |
| 42 public content::NotificationObserver { | 42 public content::NotificationObserver { |
| 43 public: | 43 public: |
| 44 PDFBrowserTest() | 44 PDFBrowserTest() |
| 45 : snapshot_different_(true), | 45 : snapshot_different_(true), |
| 46 next_dummy_search_value_(0), | 46 next_dummy_search_value_(0), |
| 47 load_stop_notification_count_(0) { | 47 load_stop_notification_count_(0) { |
| 48 pdf_test_server_.ServeFilesFromDirectory( | 48 base::FilePath src_dir; |
| 49 base::FilePath(FILE_PATH_LITERAL("pdf/test"))); | 49 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); |
| 50 pdf_test_server_.ServeFilesFromDirectory(src_dir.AppendASCII("pdf/test")); |
| 50 } | 51 } |
| 51 | 52 |
| 52 protected: | 53 protected: |
| 53 // Use our own TestServer so that we can serve files from the pdf directory. | 54 // Use our own TestServer so that we can serve files from the pdf directory. |
| 54 net::test_server::EmbeddedTestServer* pdf_test_server() { | 55 net::test_server::EmbeddedTestServer* pdf_test_server() { |
| 55 return &pdf_test_server_; | 56 return &pdf_test_server_; |
| 56 } | 57 } |
| 57 | 58 |
| 58 int load_stop_notification_count() const { | 59 int load_stop_notification_count() const { |
| 59 return load_stop_notification_count_; | 60 return load_stop_notification_count_; |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |