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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 #else | 240 #else |
241 #define MAYBE_Scroll Scroll | 241 #define MAYBE_Scroll Scroll |
242 #endif | 242 #endif |
243 // Tests that scrolling works. | 243 // Tests that scrolling works. |
244 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Scroll) { | 244 IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Scroll) { |
245 ASSERT_NO_FATAL_FAILURE(Load()); | 245 ASSERT_NO_FATAL_FAILURE(Load()); |
246 | 246 |
247 // We use wheel mouse event since that's the only one we can easily push to | 247 // We use wheel mouse event since that's the only one we can easily push to |
248 // the renderer. There's no way to push a cross-platform keyboard event at | 248 // the renderer. There's no way to push a cross-platform keyboard event at |
249 // the moment. | 249 // the moment. |
250 WebKit::WebMouseWheelEvent wheel_event; | 250 blink::WebMouseWheelEvent wheel_event; |
251 wheel_event.type = WebKit::WebInputEvent::MouseWheel; | 251 wheel_event.type = blink::WebInputEvent::MouseWheel; |
252 wheel_event.deltaY = -200; | 252 wheel_event.deltaY = -200; |
253 wheel_event.wheelTicksY = -2; | 253 wheel_event.wheelTicksY = -2; |
254 WebContents* web_contents = | 254 WebContents* web_contents = |
255 browser()->tab_strip_model()->GetActiveWebContents(); | 255 browser()->tab_strip_model()->GetActiveWebContents(); |
256 web_contents->GetRenderViewHost()->ForwardWheelEvent(wheel_event); | 256 web_contents->GetRenderViewHost()->ForwardWheelEvent(wheel_event); |
257 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); | 257 ASSERT_NO_FATAL_FAILURE(WaitForResponse()); |
258 | 258 |
259 int y_offset = 0; | 259 int y_offset = 0; |
260 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 260 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
261 browser()->tab_strip_model()->GetActiveWebContents(), | 261 browser()->tab_strip_model()->GetActiveWebContents(), |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 browser()->tab_strip_model()->GetActiveWebContents(), | 416 browser()->tab_strip_model()->GetActiveWebContents(), |
417 "reloadPDF();")); | 417 "reloadPDF();")); |
418 observer.Wait(); | 418 observer.Wait(); |
419 | 419 |
420 ASSERT_EQ("success", | 420 ASSERT_EQ("success", |
421 browser()->tab_strip_model()->GetActiveWebContents()-> | 421 browser()->tab_strip_model()->GetActiveWebContents()-> |
422 GetURL().query()); | 422 GetURL().query()); |
423 } | 423 } |
424 | 424 |
425 } // namespace | 425 } // namespace |
OLD | NEW |