| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, | 39 class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, |
| 40 public content::NotificationObserver { | 40 public content::NotificationObserver { |
| 41 public: | 41 public: |
| 42 PrintingLayoutTest() { | 42 PrintingLayoutTest() { |
| 43 base::FilePath browser_directory; | 43 base::FilePath browser_directory; |
| 44 PathService::Get(chrome::DIR_APP, &browser_directory); | 44 PathService::Get(chrome::DIR_APP, &browser_directory); |
| 45 emf_path_ = browser_directory.AppendASCII("metafile_dumps"); | 45 emf_path_ = browser_directory.AppendASCII("metafile_dumps"); |
| 46 } | 46 } |
| 47 | 47 |
| 48 virtual void SetUp() override { | 48 void SetUp() override { |
| 49 // Make sure there is no left overs. | 49 // Make sure there is no left overs. |
| 50 CleanupDumpDirectory(); | 50 CleanupDumpDirectory(); |
| 51 InProcessBrowserTest::SetUp(); | 51 InProcessBrowserTest::SetUp(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual void TearDown() override { | 54 void TearDown() override { |
| 55 InProcessBrowserTest::TearDown(); | 55 InProcessBrowserTest::TearDown(); |
| 56 base::DeleteFile(emf_path_, true); | 56 base::DeleteFile(emf_path_, true); |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual void SetUpCommandLine(base::CommandLine* command_line) override { | 59 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 60 command_line->AppendSwitchPath(switches::kDebugPrint, emf_path_); | 60 command_line->AppendSwitchPath(switches::kDebugPrint, emf_path_); |
| 61 } | 61 } |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 void PrintNowTab() { | 64 void PrintNowTab() { |
| 65 registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, | 65 registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, |
| 66 content::NotificationService::AllSources()); | 66 content::NotificationService::AllSources()); |
| 67 | 67 |
| 68 content::WebContents* web_contents = | 68 content::WebContents* web_contents = |
| 69 browser()->tab_strip_model()->GetActiveWebContents(); | 69 browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 // Force a navigation elsewhere to verify that it's fine with it. | 461 // Force a navigation elsewhere to verify that it's fine with it. |
| 462 url = test_server()->GetURL("files/printing/test1.html"); | 462 url = test_server()->GetURL("files/printing/test1.html"); |
| 463 ui_test_utils::NavigateToURL(browser(), url); | 463 ui_test_utils::NavigateToURL(browser(), url); |
| 464 } | 464 } |
| 465 chrome::CloseWindow(browser()); | 465 chrome::CloseWindow(browser()); |
| 466 content::RunAllPendingInMessageLoop(); | 466 content::RunAllPendingInMessageLoop(); |
| 467 | 467 |
| 468 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; | 468 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; |
| 469 } | 469 } |
| OLD | NEW |