| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" | 8 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" |
| 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 10 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const int64 kSlowNavigationDelayInMS = 2000; | 27 const int64 kSlowNavigationDelayInMS = 2000; |
| 28 const int64 kQuickNavigationDelayInMS = 500; | 28 const int64 kQuickNavigationDelayInMS = 500; |
| 29 | 29 |
| 30 class MockElapsedTimer : public base::ElapsedTimer { | 30 class MockElapsedTimer : public base::ElapsedTimer { |
| 31 public: | 31 public: |
| 32 MockElapsedTimer() {} | 32 MockElapsedTimer() {} |
| 33 virtual base::TimeDelta Elapsed() const override { return delta_; } | 33 base::TimeDelta Elapsed() const override { return delta_; } |
| 34 | 34 |
| 35 void Advance(int64 ms) { delta_ = base::TimeDelta::FromMilliseconds(ms); } | 35 void Advance(int64 ms) { delta_ = base::TimeDelta::FromMilliseconds(ms); } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 base::TimeDelta delta_; | 38 base::TimeDelta delta_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(MockElapsedTimer); | 40 DISALLOW_COPY_AND_ASSIGN(MockElapsedTimer); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 new password_manager::PasswordFormManager( | 317 new password_manager::PasswordFormManager( |
| 318 NULL, &client, &driver, test_form(), false)); | 318 NULL, &client, &driver, test_form(), false)); |
| 319 | 319 |
| 320 controller()->OnAutomaticPasswordSave(test_form_manager.Pass()); | 320 controller()->OnAutomaticPasswordSave(test_form_manager.Pass()); |
| 321 EXPECT_EQ(password_manager::ui::CONFIRMATION_STATE, controller()->state()); | 321 EXPECT_EQ(password_manager::ui::CONFIRMATION_STATE, controller()->state()); |
| 322 | 322 |
| 323 ManagePasswordsIconMock mock; | 323 ManagePasswordsIconMock mock; |
| 324 controller()->UpdateIconAndBubbleState(&mock); | 324 controller()->UpdateIconAndBubbleState(&mock); |
| 325 EXPECT_EQ(password_manager::ui::MANAGE_STATE, mock.state()); | 325 EXPECT_EQ(password_manager::ui::MANAGE_STATE, mock.state()); |
| 326 } | 326 } |
| OLD | NEW |