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/files/file_enumerator.h" | 5 #include "base/files/file_enumerator.h" |
6 #include "base/hash.h" | 6 #include "base/hash.h" |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/pdf/pdf_browsertest_base.h" | 9 #include "chrome/browser/ui/pdf/pdf_browsertest_base.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "content/public/browser/navigation_controller.h" | 12 #include "content/public/browser/navigation_controller.h" |
13 #include "content/public/browser/notification_source.h" | 13 #include "content/public/browser/notification_source.h" |
14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
16 #include "content/public/test/browser_test_utils.h" | 16 #include "content/public/test/browser_test_utils.h" |
17 #include "third_party/WebKit/public/web/WebInputEvent.h" | 17 #include "third_party/WebKit/public/web/WebInputEvent.h" |
18 | 18 |
19 using content::NavigationController; | 19 using content::NavigationController; |
20 using content::WebContents; | 20 using content::WebContents; |
21 | 21 |
22 // Note: All tests in here require the internal PDF plugin, so they're disabled | 22 // Note: All tests in here require the internal PDF plugin, so they're disabled |
23 // in non-official builds. We still compile them though, to prevent bitrot. | 23 // in non-official builds. We still compile them though, to prevent bitrot. |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 // Tests basic PDF rendering. This can be broken depending on bad merges with | 27 // Tests basic PDF rendering. This can be broken depending on bad merges with |
28 // the vendor, so it's important that we have basic sanity checking. | 28 // the vendor, so it's important that we have basic sanity checking. |
29 // TODO(eustas): This is failing on CROS offical build. crbug.com/446347. | 29 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_LINUX) |
30 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
31 #define MAYBE_Basic Basic | 30 #define MAYBE_Basic Basic |
32 #else | 31 #else |
33 #define MAYBE_Basic DISABLED_Basic | 32 #define MAYBE_Basic DISABLED_Basic |
34 #endif | 33 #endif |
35 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Basic) { | 34 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Basic) { |
36 ASSERT_NO_FATAL_FAILURE(Load()); | 35 ASSERT_NO_FATAL_FAILURE(Load()); |
37 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); | 36 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); |
38 // OS X uses CoreText, and FreeType renders slightly different on Linux and | 37 // OS X uses CoreText, and FreeType renders slightly different on Linux and |
39 // Win. | 38 // Win. |
40 #if defined(OS_MACOSX) | 39 #if defined(OS_MACOSX) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 &contents->GetController())); | 206 &contents->GetController())); |
208 ASSERT_TRUE(content::ExecuteScript( | 207 ASSERT_TRUE(content::ExecuteScript( |
209 browser()->tab_strip_model()->GetActiveWebContents(), | 208 browser()->tab_strip_model()->GetActiveWebContents(), |
210 "reloadPDF();")); | 209 "reloadPDF();")); |
211 observer.Wait(); | 210 observer.Wait(); |
212 | 211 |
213 ASSERT_EQ("success", contents->GetURL().query()); | 212 ASSERT_EQ("success", contents->GetURL().query()); |
214 } | 213 } |
215 | 214 |
216 } // namespace | 215 } // namespace |
OLD | NEW |