| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // A test PasswordsPrivateDelegate implementation which uses mock data. | 51 // A test PasswordsPrivateDelegate implementation which uses mock data. |
| 52 // TestDelegate starts out with kNumMocks mocks of each type (saved password | 52 // TestDelegate starts out with kNumMocks mocks of each type (saved password |
| 53 // and password exception) and removes one mock each time RemoveSavedPassword() | 53 // and password exception) and removes one mock each time RemoveSavedPassword() |
| 54 // or RemovePasswordException() is called. | 54 // or RemovePasswordException() is called. |
| 55 class TestDelegate : public PasswordsPrivateDelegate { | 55 class TestDelegate : public PasswordsPrivateDelegate { |
| 56 public: | 56 public: |
| 57 TestDelegate() : observers_(new base::ObserverListThreadSafe<Observer>()) { | 57 TestDelegate() : observers_(new base::ObserverListThreadSafe<Observer>()) { |
| 58 // Create mock data. | 58 // Create mock data. |
| 59 for (size_t i = 0; i < kNumMocks; i++) { | 59 for (size_t i = 0; i < kNumMocks; i++) { |
| 60 current_entries_.push_back(CreateEntry(i));; | 60 current_entries_.push_back(CreateEntry(i)); |
| 61 current_exceptions_.push_back(CreateException(i)); | 61 current_exceptions_.push_back(CreateException(i)); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 ~TestDelegate() override {} | 64 ~TestDelegate() override {} |
| 65 | 65 |
| 66 void AddObserver(Observer* observer) override { | 66 void AddObserver(Observer* observer) override { |
| 67 observers_->AddObserver(observer); | 67 observers_->AddObserver(observer); |
| 68 SendSavedPasswordsList(); | 68 SendSavedPasswordsList(); |
| 69 SendPasswordExceptionsList(); | 69 SendPasswordExceptionsList(); |
| 70 } | 70 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RemovePasswordException) { | 188 IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RemovePasswordException) { |
| 189 EXPECT_TRUE(RunPasswordsSubtest("removePasswordException")) << message_; | 189 EXPECT_TRUE(RunPasswordsSubtest("removePasswordException")) << message_; |
| 190 } | 190 } |
| 191 | 191 |
| 192 IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RequestPlaintextPassword) { | 192 IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RequestPlaintextPassword) { |
| 193 EXPECT_TRUE(RunPasswordsSubtest("requestPlaintextPassword")) << message_; | 193 EXPECT_TRUE(RunPasswordsSubtest("requestPlaintextPassword")) << message_; |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace extensions | 196 } // namespace extensions |
| OLD | NEW |