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

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

Issue 630603003: Replacing the OVERRIDE with override in chrome/renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/renderer/autofill/page_click_tracker_browsertest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/test/base/chrome_render_view_test.h" 8 #include "chrome/test/base/chrome_render_view_test.h"
9 #include "components/autofill/content/common/autofill_messages.h" 9 #include "components/autofill/content/common/autofill_messages.h"
10 #include "components/autofill/content/renderer/autofill_agent.h" 10 #include "components/autofill/content/renderer/autofill_agent.h"
(...skipping 27 matching lines...) Expand all
38 autofill::FormFieldData, 38 autofill::FormFieldData,
39 gfx::RectF, 39 gfx::RectF,
40 bool> AutofillQueryParam; 40 bool> AutofillQueryParam;
41 41
42 class AutofillRendererTest : public ChromeRenderViewTest { 42 class AutofillRendererTest : public ChromeRenderViewTest {
43 public: 43 public:
44 AutofillRendererTest() {} 44 AutofillRendererTest() {}
45 virtual ~AutofillRendererTest() {} 45 virtual ~AutofillRendererTest() {}
46 46
47 protected: 47 protected:
48 virtual void SetUp() OVERRIDE { 48 virtual void SetUp() override {
49 ChromeRenderViewTest::SetUp(); 49 ChromeRenderViewTest::SetUp();
50 50
51 // Don't want any delay for form state sync changes. This will still post a 51 // Don't want any delay for form state sync changes. This will still post a
52 // message so updates will get coalesced, but as soon as we spin the message 52 // message so updates will get coalesced, but as soon as we spin the message
53 // loop, it will generate an update. 53 // loop, it will generate an update.
54 SendContentStateImmediately(); 54 SendContentStateImmediately();
55 } 55 }
56 56
57 void SimulateRequestAutocompleteResult( 57 void SimulateRequestAutocompleteResult(
58 const blink::WebFormElement::AutocompleteResult& result, 58 const blink::WebFormElement::AutocompleteResult& result,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // Shouldn't crash. 247 // Shouldn't crash.
248 } 248 }
249 249
250 class RequestAutocompleteRendererTest : public AutofillRendererTest { 250 class RequestAutocompleteRendererTest : public AutofillRendererTest {
251 public: 251 public:
252 RequestAutocompleteRendererTest() 252 RequestAutocompleteRendererTest()
253 : invoking_frame_(NULL), sibling_frame_(NULL) {} 253 : invoking_frame_(NULL), sibling_frame_(NULL) {}
254 virtual ~RequestAutocompleteRendererTest() {} 254 virtual ~RequestAutocompleteRendererTest() {}
255 255
256 protected: 256 protected:
257 virtual void SetUp() OVERRIDE { 257 virtual void SetUp() override {
258 AutofillRendererTest::SetUp(); 258 AutofillRendererTest::SetUp();
259 259
260 // Bypass the HTTPS-only restriction to show requestAutocomplete. 260 // Bypass the HTTPS-only restriction to show requestAutocomplete.
261 CommandLine* command_line = CommandLine::ForCurrentProcess(); 261 CommandLine* command_line = CommandLine::ForCurrentProcess();
262 command_line->AppendSwitch(::switches::kReduceSecurityForTesting); 262 command_line->AppendSwitch(::switches::kReduceSecurityForTesting);
263 263
264 GURL url("data:text/html;charset=utf-8," 264 GURL url("data:text/html;charset=utf-8,"
265 "<form><input autocomplete=cc-number></form>"); 265 "<form><input autocomplete=cc-number></form>");
266 const char kDoubleIframeHtml[] = "<iframe id=subframe src='%s'></iframe>" 266 const char kDoubleIframeHtml[] = "<iframe id=subframe src='%s'></iframe>"
267 "<iframe id=sibling></iframe>"; 267 "<iframe id=sibling></iframe>";
(...skipping 20 matching lines...) Expand all
288 288
289 // Invoke requestAutocomplete to show the dialog. 289 // Invoke requestAutocomplete to show the dialog.
290 static_cast<blink::WebAutofillClient*>(autofill_agent_) 290 static_cast<blink::WebAutofillClient*>(autofill_agent_)
291 ->didRequestAutocomplete(invoking_form()); 291 ->didRequestAutocomplete(invoking_form());
292 ASSERT_TRUE(render_thread_->sink().GetFirstMessageMatching( 292 ASSERT_TRUE(render_thread_->sink().GetFirstMessageMatching(
293 AutofillHostMsg_RequestAutocomplete::ID)); 293 AutofillHostMsg_RequestAutocomplete::ID));
294 294
295 render_thread_->sink().ClearMessages(); 295 render_thread_->sink().ClearMessages();
296 } 296 }
297 297
298 virtual void TearDown() OVERRIDE { 298 virtual void TearDown() override {
299 invoking_form_.reset(); 299 invoking_form_.reset();
300 AutofillRendererTest::TearDown(); 300 AutofillRendererTest::TearDown();
301 } 301 }
302 302
303 void NavigateFrame(WebFrame* frame) { 303 void NavigateFrame(WebFrame* frame) {
304 frame->loadRequest(WebURLRequest(GURL("about:blank"))); 304 frame->loadRequest(WebURLRequest(GURL("about:blank")));
305 ProcessPendingMessages(); 305 ProcessPendingMessages();
306 } 306 }
307 307
308 const WebFormElement& invoking_form() const { return invoking_form_; } 308 const WebFormElement& invoking_form() const { return invoking_form_; }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) { 365 TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) {
366 // Attempting to show the requestAutocomplete dialog again should be ignored. 366 // Attempting to show the requestAutocomplete dialog again should be ignored.
367 static_cast<blink::WebAutofillClient*>(autofill_agent_) 367 static_cast<blink::WebAutofillClient*>(autofill_agent_)
368 ->didRequestAutocomplete(invoking_form()); 368 ->didRequestAutocomplete(invoking_form());
369 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( 369 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
370 AutofillHostMsg_RequestAutocomplete::ID)); 370 AutofillHostMsg_RequestAutocomplete::ID));
371 } 371 }
372 372
373 } // namespace autofill 373 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/autofill/page_click_tracker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698