OLD | NEW |
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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // the former, we will sometimes fail to observe a LOAD_STOP. | 281 // the former, we will sometimes fail to observe a LOAD_STOP. |
282 // TODO(estade): Should the controller observe LOAD_STOP instead? | 282 // TODO(estade): Should the controller observe LOAD_STOP instead? |
283 class NavEntryCommittedObserver : public content::WindowedNotificationObserver { | 283 class NavEntryCommittedObserver : public content::WindowedNotificationObserver { |
284 public: | 284 public: |
285 NavEntryCommittedObserver(const GURL& url, | 285 NavEntryCommittedObserver(const GURL& url, |
286 const content::NotificationSource& source) | 286 const content::NotificationSource& source) |
287 : WindowedNotificationObserver(content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 287 : WindowedNotificationObserver(content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
288 source), | 288 source), |
289 url_(url) {} | 289 url_(url) {} |
290 | 290 |
291 virtual ~NavEntryCommittedObserver() {} | 291 ~NavEntryCommittedObserver() override {} |
292 | 292 |
293 // content::NotificationObserver: | 293 // content::NotificationObserver: |
294 virtual void Observe(int type, | 294 void Observe(int type, |
295 const content::NotificationSource& source, | 295 const content::NotificationSource& source, |
296 const content::NotificationDetails& details) override { | 296 const content::NotificationDetails& details) override { |
297 content::LoadCommittedDetails* load_details = | 297 content::LoadCommittedDetails* load_details = |
298 content::Details<content::LoadCommittedDetails>(details).ptr(); | 298 content::Details<content::LoadCommittedDetails>(details).ptr(); |
299 if (load_details->entry->GetVirtualURL() != url_) | 299 if (load_details->entry->GetVirtualURL() != url_) |
300 return; | 300 return; |
301 | 301 |
302 WindowedNotificationObserver::Observe(type, source, details); | 302 WindowedNotificationObserver::Observe(type, source, details); |
303 } | 303 } |
304 | 304 |
305 private: | 305 private: |
306 GURL url_; | 306 GURL url_; |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 EXPECT_TRUE(RunTestPage(http_server)); | 1498 EXPECT_TRUE(RunTestPage(http_server)); |
1499 } | 1499 } |
1500 | 1500 |
1501 // Like the parent test, but doesn't add the --reduce-security-for-testing flag. | 1501 // Like the parent test, but doesn't add the --reduce-security-for-testing flag. |
1502 class AutofillDialogControllerSecurityTest : | 1502 class AutofillDialogControllerSecurityTest : |
1503 public AutofillDialogControllerTest { | 1503 public AutofillDialogControllerTest { |
1504 public: | 1504 public: |
1505 AutofillDialogControllerSecurityTest() {} | 1505 AutofillDialogControllerSecurityTest() {} |
1506 virtual ~AutofillDialogControllerSecurityTest() {} | 1506 virtual ~AutofillDialogControllerSecurityTest() {} |
1507 | 1507 |
1508 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1508 void SetUpCommandLine(CommandLine* command_line) override { |
1509 CHECK(!command_line->HasSwitch(::switches::kReduceSecurityForTesting)); | 1509 CHECK(!command_line->HasSwitch(::switches::kReduceSecurityForTesting)); |
1510 } | 1510 } |
1511 | 1511 |
1512 typedef net::BaseTestServer::SSLOptions SSLOptions; | 1512 typedef net::BaseTestServer::SSLOptions SSLOptions; |
1513 | 1513 |
1514 private: | 1514 private: |
1515 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerSecurityTest); | 1515 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerSecurityTest); |
1516 }; | 1516 }; |
1517 | 1517 |
1518 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerSecurityTest, | 1518 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerSecurityTest, |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 "<input autocomplete='transaction-currency' value='USD' readonly>" | 1785 "<input autocomplete='transaction-currency' value='USD' readonly>" |
1786 "<input autocomplete='cc-csc'>"); | 1786 "<input autocomplete='cc-csc'>"); |
1787 AutofillDialogControllerImpl* controller = SetUpHtmlAndInvoke(html); | 1787 AutofillDialogControllerImpl* controller = SetUpHtmlAndInvoke(html); |
1788 ASSERT_TRUE(controller); | 1788 ASSERT_TRUE(controller); |
1789 | 1789 |
1790 EXPECT_EQ(ASCIIToUTF16("24"), controller->transaction_amount_); | 1790 EXPECT_EQ(ASCIIToUTF16("24"), controller->transaction_amount_); |
1791 EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_); | 1791 EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_); |
1792 } | 1792 } |
1793 | 1793 |
1794 } // namespace autofill | 1794 } // namespace autofill |
OLD | NEW |