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

Side by Side Diff: chrome/renderer/autofill/page_click_tracker_browsertest.cc

Issue 2454913003: MainFrame scrollbars should work with RFV instead of FV (Closed)
Patch Set: Fix broken chromeos bot Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <memory> 5 #include <memory>
6 6
7 #include "chrome/test/base/chrome_render_view_test.h" 7 #include "chrome/test/base/chrome_render_view_test.h"
8 #include "components/autofill/content/renderer/page_click_listener.h" 8 #include "components/autofill/content/renderer/page_click_listener.h"
9 #include "components/autofill/content/renderer/page_click_tracker.h" 9 #include "components/autofill/content/renderer/page_click_tracker.h"
10 #include "content/public/renderer/render_view.h" 10 #include "content/public/renderer/render_view.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "third_party/WebKit/public/platform/WebFloatPoint.h" 12 #include "third_party/WebKit/public/platform/WebFloatPoint.h"
13 #include "third_party/WebKit/public/platform/WebSize.h" 13 #include "third_party/WebKit/public/platform/WebSize.h"
14 #include "third_party/WebKit/public/web/WebDocument.h" 14 #include "third_party/WebKit/public/web/WebDocument.h"
15 #include "third_party/WebKit/public/web/WebInputElement.h" 15 #include "third_party/WebKit/public/web/WebInputElement.h"
16 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
16 #include "third_party/WebKit/public/web/WebSettings.h" 17 #include "third_party/WebKit/public/web/WebSettings.h"
17 #include "third_party/WebKit/public/web/WebView.h" 18 #include "third_party/WebKit/public/web/WebView.h"
18 #include "ui/events/keycodes/keyboard_codes.h" 19 #include "ui/events/keycodes/keyboard_codes.h"
20 #include "ui/native_theme/native_theme_switches.h"
21
22 using blink::WebRuntimeFeatures;
19 23
20 namespace autofill { 24 namespace autofill {
21 25
22 class TestPageClickListener : public PageClickListener { 26 class TestPageClickListener : public PageClickListener {
23 public: 27 public:
24 TestPageClickListener() 28 TestPageClickListener()
25 : form_control_element_clicked_called_(false), 29 : form_control_element_clicked_called_(false),
26 was_focused_(false) {} 30 was_focused_(false) {}
27 31
28 void FormControlElementClicked(const blink::WebFormControlElement& element, 32 void FormControlElementClicked(const blink::WebFormControlElement& element,
(...skipping 12 matching lines...) Expand all
41 bool form_control_element_clicked_called_; 45 bool form_control_element_clicked_called_;
42 blink::WebFormControlElement form_control_element_clicked_; 46 blink::WebFormControlElement form_control_element_clicked_;
43 bool was_focused_; 47 bool was_focused_;
44 }; 48 };
45 49
46 class PageClickTrackerTest : public ChromeRenderViewTest { 50 class PageClickTrackerTest : public ChromeRenderViewTest {
47 protected: 51 protected:
48 void SetUp() override { 52 void SetUp() override {
49 ChromeRenderViewTest::SetUp(); 53 ChromeRenderViewTest::SetUp();
50 54
55 WebRuntimeFeatures::enableOverlayScrollbars(
56 ui::IsOverlayScrollbarEnabled());
57
51 // RenderView creates PageClickTracker but it doesn't keep it around. 58 // RenderView creates PageClickTracker but it doesn't keep it around.
52 // Rather than make it do so for the test, we create a new object. 59 // Rather than make it do so for the test, we create a new object.
53 page_click_tracker_.reset(new PageClickTracker(view_->GetMainRenderFrame(), 60 page_click_tracker_.reset(new PageClickTracker(view_->GetMainRenderFrame(),
54 &test_listener_)); 61 &test_listener_));
55 62
56 // Must be set before loading HTML. 63 // Must be set before loading HTML.
57 view_->GetWebView()->setDefaultPageScaleLimits(1, 4); 64 view_->GetWebView()->setDefaultPageScaleLimits(1, 4);
58 65
59 LoadHTML("<form>" 66 LoadHTML("<form>"
60 " <input type='text' id='text_1'></input><br>" 67 " <input type='text' id='text_1'></input><br>"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // Tap outside of element bounds, but tap width is overlapping the field. 246 // Tap outside of element bounds, but tap width is overlapping the field.
240 gfx::Rect element_bounds = GetElementBounds("text_1"); 247 gfx::Rect element_bounds = GetElementBounds("text_1");
241 SimulateRectTap(element_bounds - 248 SimulateRectTap(element_bounds -
242 gfx::Vector2d(element_bounds.width() / 2 + 1, 0)); 249 gfx::Vector2d(element_bounds.width() / 2 + 1, 0));
243 EXPECT_TRUE(test_listener_.form_control_element_clicked_called_); 250 EXPECT_TRUE(test_listener_.form_control_element_clicked_called_);
244 EXPECT_FALSE(test_listener_.was_focused_); 251 EXPECT_FALSE(test_listener_.was_focused_);
245 EXPECT_TRUE(text_ == test_listener_.form_control_element_clicked_); 252 EXPECT_TRUE(text_ == test_listener_.form_control_element_clicked_);
246 } 253 }
247 254
248 } // namespace autofill 255 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698