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

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

Issue 663333002: Standardize usage of virtual/override/final in chrome/renderer/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | chrome/renderer/benchmarking_extension.cc » ('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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "components/autofill/content/renderer/page_click_listener.h" 6 #include "components/autofill/content/renderer/page_click_listener.h"
7 #include "components/autofill/content/renderer/page_click_tracker.h" 7 #include "components/autofill/content/renderer/page_click_tracker.h"
8 #include "content/public/renderer/render_view.h" 8 #include "content/public/renderer/render_view.h"
9 #include "content/public/test/render_view_test.h" 9 #include "content/public/test/render_view_test.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/WebKit/public/web/WebDocument.h" 11 #include "third_party/WebKit/public/web/WebDocument.h"
12 #include "third_party/WebKit/public/web/WebInputElement.h" 12 #include "third_party/WebKit/public/web/WebInputElement.h"
13 #include "third_party/WebKit/public/web/WebTextAreaElement.h" 13 #include "third_party/WebKit/public/web/WebTextAreaElement.h"
14 #include "third_party/WebKit/public/web/WebView.h" 14 #include "third_party/WebKit/public/web/WebView.h"
15 #include "third_party/WebKit/public/platform/WebSize.h" 15 #include "third_party/WebKit/public/platform/WebSize.h"
16 #include "ui/events/keycodes/keyboard_codes.h" 16 #include "ui/events/keycodes/keyboard_codes.h"
17 17
18 namespace autofill { 18 namespace autofill {
19 19
20 class TestPageClickListener : public PageClickListener { 20 class TestPageClickListener : public PageClickListener {
21 public: 21 public:
22 TestPageClickListener() 22 TestPageClickListener()
23 : form_control_element_clicked_called_(false), 23 : form_control_element_clicked_called_(false),
24 was_focused_(false) {} 24 was_focused_(false) {}
25 25
26 virtual void FormControlElementClicked( 26 void FormControlElementClicked(const blink::WebFormControlElement& element,
27 const blink::WebFormControlElement& element, 27 bool was_focused) override {
28 bool was_focused) override {
29 form_control_element_clicked_called_ = true; 28 form_control_element_clicked_called_ = true;
30 form_control_element_clicked_ = element; 29 form_control_element_clicked_ = element;
31 was_focused_ = was_focused; 30 was_focused_ = was_focused;
32 } 31 }
33 32
34 void ClearResults() { 33 void ClearResults() {
35 form_control_element_clicked_called_ = false; 34 form_control_element_clicked_called_ = false;
36 form_control_element_clicked_.reset(); 35 form_control_element_clicked_.reset();
37 was_focused_ = false; 36 was_focused_ = false;
38 } 37 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 EXPECT_TRUE(test_listener_.was_focused_); 142 EXPECT_TRUE(test_listener_.was_focused_);
144 EXPECT_TRUE(textarea_ == test_listener_.form_control_element_clicked_); 143 EXPECT_TRUE(textarea_ == test_listener_.form_control_element_clicked_);
145 test_listener_.ClearResults(); 144 test_listener_.ClearResults();
146 145
147 // Click the button, no notification should happen (this is not a text-input). 146 // Click the button, no notification should happen (this is not a text-input).
148 SendElementClick("button"); 147 SendElementClick("button");
149 EXPECT_FALSE(test_listener_.form_control_element_clicked_called_); 148 EXPECT_FALSE(test_listener_.form_control_element_clicked_called_);
150 } 149 }
151 150
152 } // namespace autofill 151 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698