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/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 return FilePath(FilePath::kCurrentDirectory).AppendASCII(".."). | 62 return FilePath(FilePath::kCurrentDirectory).AppendASCII(".."). |
63 AppendASCII("..").AppendASCII("..").AppendASCII("pdf"). | 63 AppendASCII("..").AppendASCII("..").AppendASCII("pdf"). |
64 AppendASCII("test"); | 64 AppendASCII("test"); |
65 } | 65 } |
66 | 66 |
67 void Load() { | 67 void Load() { |
68 // Make sure to set the window size before rendering, as otherwise rendering | 68 // Make sure to set the window size before rendering, as otherwise rendering |
69 // to a smaller window and then expanding leads to slight anti-aliasing | 69 // to a smaller window and then expanding leads to slight anti-aliasing |
70 // differences of the text and the pixel comparison fails. | 70 // differences of the text and the pixel comparison fails. |
71 gfx::Rect bounds(gfx::Rect(0, 0, kBrowserWidth, kBrowserHeight)); | 71 gfx::Rect bounds(gfx::Rect(0, 0, kBrowserWidth, kBrowserHeight)); |
72 gfx::Rect screen_bounds = gfx::Screen::GetPrimaryMonitorBounds(); | 72 gfx::Rect screen_bounds = gfx::Screen::GetPrimaryMonitor().bounds(); |
73 ASSERT_GT(screen_bounds.width(), kBrowserWidth); | 73 ASSERT_GT(screen_bounds.width(), kBrowserWidth); |
74 ASSERT_GT(screen_bounds.height(), kBrowserHeight); | 74 ASSERT_GT(screen_bounds.height(), kBrowserHeight); |
75 browser()->window()->SetBounds(bounds); | 75 browser()->window()->SetBounds(bounds); |
76 | 76 |
77 GURL url(ui_test_utils::GetTestUrl( | 77 GURL url(ui_test_utils::GetTestUrl( |
78 GetPDFTestDir(), | 78 GetPDFTestDir(), |
79 FilePath(FILE_PATH_LITERAL("pdf_browsertest.pdf")))); | 79 FilePath(FILE_PATH_LITERAL("pdf_browsertest.pdf")))); |
80 ui_test_utils::NavigateToURL(browser(), url); | 80 ui_test_utils::NavigateToURL(browser(), url); |
81 } | 81 } |
82 | 82 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 353 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
354 browser()->GetSelectedWebContents()->GetRenderViewHost(), | 354 browser()->GetSelectedWebContents()->GetRenderViewHost(), |
355 std::wstring(), | 355 std::wstring(), |
356 L"reloadPDF();")); | 356 L"reloadPDF();")); |
357 observer.Wait(); | 357 observer.Wait(); |
358 | 358 |
359 ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); | 359 ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); |
360 } | 360 } |
361 | 361 |
362 } // namespace | 362 } // namespace |
OLD | NEW |