OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 personal_data_->Init(profile_.get()); | 92 personal_data_->Init(profile_.get()); |
93 personal_data_->AddObserver(&personal_data_observer_); | 93 personal_data_->AddObserver(&personal_data_observer_); |
94 | 94 |
95 // Verify that the web database has been updated and the notification sent. | 95 // Verify that the web database has been updated and the notification sent. |
96 EXPECT_CALL(personal_data_observer_, | 96 EXPECT_CALL(personal_data_observer_, |
97 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 97 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
98 base::MessageLoop::current()->Run(); | 98 base::MessageLoop::current()->Run(); |
99 } | 99 } |
100 | 100 |
101 void MakeProfileIncognito() { | 101 void MakeProfileIncognito() { |
102 profile_->set_incognito(true); | 102 // Switch to an incognito profile. |
| 103 profile_->ForceIncognito(true); |
| 104 DCHECK(profile_->IsOffTheRecord()); |
103 } | 105 } |
104 | 106 |
105 base::MessageLoopForUI message_loop_; | 107 base::MessageLoopForUI message_loop_; |
106 content::TestBrowserThread ui_thread_; | 108 content::TestBrowserThread ui_thread_; |
107 content::TestBrowserThread db_thread_; | 109 content::TestBrowserThread db_thread_; |
108 scoped_ptr<TestingProfile> profile_; | 110 scoped_ptr<TestingProfile> profile_; |
109 scoped_ptr<PersonalDataManager> personal_data_; | 111 scoped_ptr<PersonalDataManager> personal_data_; |
110 PersonalDataLoadedObserverMock personal_data_observer_; | 112 PersonalDataLoadedObserverMock personal_data_observer_; |
111 }; | 113 }; |
112 | 114 |
(...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 // Removing shouldn't work. | 2411 // Removing shouldn't work. |
2410 personal_data_->RemoveByGUID(steve_jobs.guid()); | 2412 personal_data_->RemoveByGUID(steve_jobs.guid()); |
2411 personal_data_->RemoveByGUID(bill_gates.guid()); | 2413 personal_data_->RemoveByGUID(bill_gates.guid()); |
2412 | 2414 |
2413 ResetPersonalDataManager(); | 2415 ResetPersonalDataManager(); |
2414 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); | 2416 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); |
2415 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); | 2417 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); |
2416 } | 2418 } |
2417 | 2419 |
2418 } // namespace autofill | 2420 } // namespace autofill |
OLD | NEW |