| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <Cocoa/Cocoa.h> | 5 #include <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 : event_queue_(), touch_(CGPointMake(0, 0)) { | 75 : event_queue_(), touch_(CGPointMake(0, 0)) { |
| 76 const base::FilePath base_path(FILE_PATH_LITERAL("scroll")); | 76 const base::FilePath base_path(FILE_PATH_LITERAL("scroll")); |
| 77 url1_ = ui_test_utils::GetTestUrl( | 77 url1_ = ui_test_utils::GetTestUrl( |
| 78 base_path, base::FilePath(FILE_PATH_LITERAL("text.html"))); | 78 base_path, base::FilePath(FILE_PATH_LITERAL("text.html"))); |
| 79 url2_ = ui_test_utils::GetTestUrl( | 79 url2_ = ui_test_utils::GetTestUrl( |
| 80 base_path, base::FilePath(FILE_PATH_LITERAL("blank.html"))); | 80 base_path, base::FilePath(FILE_PATH_LITERAL("blank.html"))); |
| 81 url_iframe_ = ui_test_utils::GetTestUrl( | 81 url_iframe_ = ui_test_utils::GetTestUrl( |
| 82 base_path, base::FilePath(FILE_PATH_LITERAL("iframe.html"))); | 82 base_path, base::FilePath(FILE_PATH_LITERAL("iframe.html"))); |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual void SetUpOnMainThread() OVERRIDE { | 85 virtual void SetUpOnMainThread() override { |
| 86 event_queue_.reset([[NSMutableArray alloc] init]); | 86 event_queue_.reset([[NSMutableArray alloc] init]); |
| 87 touch_ = CGPointMake(0.5, 0.5); | 87 touch_ = CGPointMake(0.5, 0.5); |
| 88 | 88 |
| 89 // Ensure that the navigation stack is not empty. | 89 // Ensure that the navigation stack is not empty. |
| 90 ui_test_utils::NavigateToURL(browser(), url1_); | 90 ui_test_utils::NavigateToURL(browser(), url1_); |
| 91 ASSERT_EQ(url1_, GetWebContents()->GetURL()); | 91 ASSERT_EQ(url1_, GetWebContents()->GetURL()); |
| 92 ui_test_utils::NavigateToURL(browser(), url2_); | 92 ui_test_utils::NavigateToURL(browser(), url2_); |
| 93 ASSERT_EQ(url2_, GetWebContents()->GetURL()); | 93 ASSERT_EQ(url2_, GetWebContents()->GetURL()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 virtual void TearDownOnMainThread() OVERRIDE { | 96 virtual void TearDownOnMainThread() override { |
| 97 event_queue_.reset(); | 97 event_queue_.reset(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 protected: | 100 protected: |
| 101 // Returns the active web contents. | 101 // Returns the active web contents. |
| 102 content::WebContents* GetWebContents() { | 102 content::WebContents* GetWebContents() { |
| 103 return browser()->tab_strip_model()->GetActiveWebContents(); | 103 return browser()->tab_strip_model()->GetActiveWebContents(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 // Returns the value of |query| from Javascript as an int. | 106 // Returns the value of |query| from Javascript as an int. |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 QueueTouch( | 722 QueueTouch( |
| 723 DEPLOYMENT_TOUCHES_MOVED, NSEventTypeEndGesture, NSMouseEventSubtype, NO); | 723 DEPLOYMENT_TOUCHES_MOVED, NSEventTypeEndGesture, NSMouseEventSubtype, NO); |
| 724 QueueGestureEnd(); | 724 QueueGestureEnd(); |
| 725 QueueTouch( | 725 QueueTouch( |
| 726 DEPLOYMENT_TOUCHES_ENDED, NSEventTypeEndGesture, NSMouseEventSubtype, NO); | 726 DEPLOYMENT_TOUCHES_ENDED, NSEventTypeEndGesture, NSMouseEventSubtype, NO); |
| 727 QueueTrackpadScroll(0, 0, NSEventPhaseEnded, YES); | 727 QueueTrackpadScroll(0, 0, NSEventPhaseEnded, YES); |
| 728 | 728 |
| 729 RunQueuedEvents(); | 729 RunQueuedEvents(); |
| 730 ExpectUrlAndOffset(url1_, 0); | 730 ExpectUrlAndOffset(url1_, 0); |
| 731 } | 731 } |
| OLD | NEW |