| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | 10 #include "chrome/browser/ui/webui/web_ui_browsertest.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 TestTabStripModelObserver tabstrip_observer(browser->tabstrip_model(), | 26 TestTabStripModelObserver tabstrip_observer(browser->tabstrip_model(), |
| 27 load_start_observer); | 27 load_start_observer); |
| 28 TabContents* initiator_tab_contents = browser->GetSelectedTabContents(); | 28 TabContents* initiator_tab_contents = browser->GetSelectedTabContents(); |
| 29 browser->Print(); | 29 browser->Print(); |
| 30 tabstrip_observer.WaitForObservation(); | 30 tabstrip_observer.WaitForObservation(); |
| 31 EXPECT_NE(initiator_tab_contents, browser->GetSelectedTabContents()); | 31 EXPECT_NE(initiator_tab_contents, browser->GetSelectedTabContents()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 // crbug.com/88104 - v8_shell#host doesn't build when host=="arm". |
| 37 #if !defined(ARCH_CPU_ARM_FAMILY) |
| 38 |
| 36 class PrintPreviewWebUITest | 39 class PrintPreviewWebUITest |
| 37 : public WebUIBrowserTest, | 40 : public WebUIBrowserTest, |
| 38 public TestTabStripModelObserver::LoadStartObserver { | 41 public TestTabStripModelObserver::LoadStartObserver { |
| 39 protected: | 42 protected: |
| 40 // WebUIBrowserTest: | 43 // WebUIBrowserTest: |
| 41 virtual void SetUpOnMainThread() OVERRIDE { | 44 virtual void SetUpOnMainThread() OVERRIDE { |
| 42 WebUIBrowserTest::SetUpOnMainThread(); | 45 WebUIBrowserTest::SetUpOnMainThread(); |
| 43 if (!HasPDFLib()) | 46 if (!HasPDFLib()) |
| 44 skipTest(base::StringPrintf("%s:%d: No PDF Lib.", __FILE__, __LINE__)); | 47 skipTest(base::StringPrintf("%s:%d: No PDF Lib.", __FILE__, __LINE__)); |
| 45 | 48 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 65 PreLoadJavascriptLibraries(true); | 68 PreLoadJavascriptLibraries(true); |
| 66 } | 69 } |
| 67 | 70 |
| 68 bool HasPDFLib() const { | 71 bool HasPDFLib() const { |
| 69 FilePath pdf; | 72 FilePath pdf; |
| 70 return PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && | 73 return PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && |
| 71 file_util::PathExists(pdf); | 74 file_util::PathExists(pdf); |
| 72 } | 75 } |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 IN_PROC_BROWSER_TEST_F(PrintPreviewWebUITest, FLAKY_TestPrintPreview) { | 78 #include "js2webui/chrome/test/data/webui/print_preview-inl.h" |
| 76 ASSERT_TRUE(RunJavascriptTest("testPrintPreview", | 79 |
| 77 *Value::CreateBooleanValue(HasPDFLib()))); | 80 #endif // !defined(ARCH_CPU_ARM_FAMILY) |
| 78 } | |
| OLD | NEW |