| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/login/screens/mock_error_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/mock_error_screen.h" |
| 6 | 6 |
| 7 using ::testing::AtLeast; | 7 using ::testing::AtLeast; |
| 8 using ::testing::_; | 8 using ::testing::_; |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ErrorScreen::SetUIState(ui_state); | 26 ErrorScreen::SetUIState(ui_state); |
| 27 MockSetUIState(ui_state); | 27 MockSetUIState(ui_state); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void MockErrorScreen::SetErrorState(NetworkError::ErrorState error_state, | 30 void MockErrorScreen::SetErrorState(NetworkError::ErrorState error_state, |
| 31 const std::string& network) { | 31 const std::string& network) { |
| 32 ErrorScreen::SetErrorState(error_state, network); | 32 ErrorScreen::SetErrorState(error_state, network); |
| 33 MockSetErrorState(error_state, network); | 33 MockSetErrorState(error_state, network); |
| 34 } | 34 } |
| 35 | 35 |
| 36 MockNetworkErrorView::MockNetworkErrorView() : model_(nullptr) { | 36 MockNetworkErrorView::MockNetworkErrorView() { |
| 37 EXPECT_CALL(*this, MockBind(_)).Times(AtLeast(1)); | 37 EXPECT_CALL(*this, MockBind(_)).Times(AtLeast(1)); |
| 38 EXPECT_CALL(*this, MockUnbind()).Times(AtLeast(1)); | 38 EXPECT_CALL(*this, MockUnbind()).Times(AtLeast(1)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 MockNetworkErrorView::~MockNetworkErrorView() { | 41 MockNetworkErrorView::~MockNetworkErrorView() { |
| 42 if (model_) | 42 if (screen_) |
| 43 model_->OnViewDestroyed(this); | 43 screen_->OnViewDestroyed(this); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void MockNetworkErrorView::Bind(NetworkErrorModel& model) { | 46 void MockNetworkErrorView::Bind(ErrorScreen* screen) { |
| 47 model_ = &model; | 47 screen_ = screen; |
| 48 MockBind(model); | 48 MockBind(screen); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void MockNetworkErrorView::Unbind() { | 51 void MockNetworkErrorView::Unbind() { |
| 52 model_ = nullptr; | 52 screen_ = nullptr; |
| 53 MockUnbind(); | 53 MockUnbind(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace chromeos | 56 } // namespace chromeos |
| OLD | NEW |