OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/guid.h" | 5 #include "base/guid.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.h" | 7 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "components/autofill/core/browser/autofill_test_utils.h" | |
11 #include "components/autofill/core/browser/card_unmask_delegate.h" | 12 #include "components/autofill/core/browser/card_unmask_delegate.h" |
12 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
13 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
14 | 15 |
15 namespace autofill { | 16 namespace autofill { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 class TestCardUnmaskDelegate : public CardUnmaskDelegate { | 20 class TestCardUnmaskDelegate : public CardUnmaskDelegate { |
20 public: | 21 public: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 // This member must outlive the controller. | 92 // This member must outlive the controller. |
92 scoped_refptr<content::MessageLoopRunner> runner_; | 93 scoped_refptr<content::MessageLoopRunner> runner_; |
93 | 94 |
94 scoped_ptr<TestCardUnmaskPromptController> controller_; | 95 scoped_ptr<TestCardUnmaskPromptController> controller_; |
95 scoped_ptr<TestCardUnmaskDelegate> delegate_; | 96 scoped_ptr<TestCardUnmaskDelegate> delegate_; |
96 | 97 |
97 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewBrowserTest); | 98 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewBrowserTest); |
98 }; | 99 }; |
99 | 100 |
100 IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) { | 101 IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) { |
101 CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); | 102 CreditCard credit_card(CreditCard::MASKED_SERVER_CARD, "a123"); |
103 test::SetCreditCardInfo(&credit_card, "Bonnie Parker", | |
104 "2109" /* Mastercard */, "12", "2012"); | |
105 credit_card.SetTypeForMaskedCard(kMasterCard); | |
bondd
2015/03/06 23:57:15
estade@ emailed me this as a fix for the broken br
| |
102 | 106 |
103 controller()->ShowPrompt(credit_card, delegate()->GetWeakPtr()); | 107 controller()->ShowPrompt(credit_card, delegate()->GetWeakPtr()); |
104 controller()->RunMessageLoop(); | 108 controller()->RunMessageLoop(); |
105 } | 109 } |
106 | 110 |
107 } // namespace | 111 } // namespace |
108 | 112 |
109 } // namespace autofill | 113 } // namespace autofill |
OLD | NEW |