Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 1735833002: Remove WebContentsObserver::DidGetUserGesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(type, blink::WebInputEvent::Undefined);
Lei Zhang 2016/02/26 02:38:39 Reverse the arguments - EXPECT_EQ(expected_val, ac
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/engagement/site_engagement_helper.cc ('k') | content/browser/renderer_host/render_widget_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698