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

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: 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 {
tdresser 2016/02/25 14:42:48 Can we add a test that the type here is sane?
dominickn 2016/02/26 00:36:11 Done.
2103 got_user_gesture_ = true;
2104 }
2103 2105
2104 bool got_user_gesture() const { 2106 bool got_user_gesture() const {
2105 return got_user_gesture_; 2107 return got_user_gesture_;
2106 } 2108 }
2107 2109
2108 void set_got_user_gesture(bool got_it) { 2110 void set_got_user_gesture(bool got_it) {
2109 got_user_gesture_ = got_it; 2111 got_user_gesture_ = got_it;
2110 } 2112 }
2111 2113
2112 private: 2114 private:
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 Browser* browser = new Browser(params); 3294 Browser* browser = new Browser(params);
3293 gfx::Rect bounds = browser->window()->GetBounds(); 3295 gfx::Rect bounds = browser->window()->GetBounds();
3294 3296
3295 // Should be EXPECT_EQ, but this width is inconsistent across platforms. 3297 // Should be EXPECT_EQ, but this width is inconsistent across platforms.
3296 // See https://crbug.com/567925. 3298 // See https://crbug.com/567925.
3297 EXPECT_GE(bounds.width(), 100); 3299 EXPECT_GE(bounds.width(), 100);
3298 EXPECT_EQ(122, bounds.height()); 3300 EXPECT_EQ(122, bounds.height());
3299 browser->window()->Close(); 3301 browser->window()->Close();
3300 } 3302 }
3301 } 3303 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698