OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2092 // interstitial is deleted now. | 2092 // interstitial is deleted now. |
2093 } | 2093 } |
2094 | 2094 |
2095 class MockWebContentsObserver : public WebContentsObserver { | 2095 class MockWebContentsObserver : public WebContentsObserver { |
2096 public: | 2096 public: |
2097 explicit MockWebContentsObserver(WebContents* web_contents) | 2097 explicit MockWebContentsObserver(WebContents* web_contents) |
2098 : WebContentsObserver(web_contents), | 2098 : WebContentsObserver(web_contents), |
2099 got_user_gesture_(false) { | 2099 got_user_gesture_(false) { |
2100 } | 2100 } |
2101 | 2101 |
2102 void DidGetUserGesture() override { got_user_gesture_ = true; } | 2102 void DidGetUserInteraction(const blink::WebInputEvent::Type type) override { |
| 2103 // We expect the only interaction here to be a browser-initiated navigation, |
| 2104 // which is sent with the Undefined event type. |
| 2105 EXPECT_EQ(blink::WebInputEvent::Undefined, type); |
| 2106 got_user_gesture_ = true; |
| 2107 } |
2103 | 2108 |
2104 bool got_user_gesture() const { | 2109 bool got_user_gesture() const { |
2105 return got_user_gesture_; | 2110 return got_user_gesture_; |
2106 } | 2111 } |
2107 | 2112 |
2108 void set_got_user_gesture(bool got_it) { | 2113 void set_got_user_gesture(bool got_it) { |
2109 got_user_gesture_ = got_it; | 2114 got_user_gesture_ = got_it; |
2110 } | 2115 } |
2111 | 2116 |
2112 private: | 2117 private: |
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3292 Browser* browser = new Browser(params); | 3297 Browser* browser = new Browser(params); |
3293 gfx::Rect bounds = browser->window()->GetBounds(); | 3298 gfx::Rect bounds = browser->window()->GetBounds(); |
3294 | 3299 |
3295 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 3300 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
3296 // See https://crbug.com/567925. | 3301 // See https://crbug.com/567925. |
3297 EXPECT_GE(bounds.width(), 100); | 3302 EXPECT_GE(bounds.width(), 100); |
3298 EXPECT_EQ(122, bounds.height()); | 3303 EXPECT_EQ(122, bounds.height()); |
3299 browser->window()->Close(); | 3304 browser->window()->Close(); |
3300 } | 3305 } |
3301 } | 3306 } |
OLD | NEW |