| 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 "ios/web/active_state_manager_impl.h" | 5 #include "ios/web/active_state_manager_impl.h" |
| 6 | 6 |
| 7 #include "ios/web/public/active_state_manager.h" | 7 #include "ios/web/public/active_state_manager.h" |
| 8 #include "ios/web/public/browser_state.h" | 8 #include "ios/web/public/browser_state.h" |
| 9 #include "ios/web/public/test/fakes/test_browser_state.h" | 9 #include "ios/web/public/test/fakes/test_browser_state.h" |
| 10 #include "ios/web/public/test/test_web_thread_bundle.h" | 10 #include "ios/web/public/test/test_web_thread_bundle.h" |
| 11 #include "ios/web/public/test/web_test.h" | 11 #include "ios/web/public/test/web_test.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
| 15 | 15 |
| 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 17 #error "This file requires ARC support." |
| 18 #endif |
| 19 |
| 16 namespace web { | 20 namespace web { |
| 17 namespace { | 21 namespace { |
| 18 | 22 |
| 19 // A test fixture to test ActiveStateManagerImpl. | 23 // A test fixture to test ActiveStateManagerImpl. |
| 20 typedef WebTest ActiveStateManagerImplTest; | 24 typedef WebTest ActiveStateManagerImplTest; |
| 21 | 25 |
| 22 // An ActiveStateManager::Observer used for testing purposes. | 26 // An ActiveStateManager::Observer used for testing purposes. |
| 23 class ActiveStateManagerObserver : public ActiveStateManager::Observer { | 27 class ActiveStateManagerObserver : public ActiveStateManager::Observer { |
| 24 public: | 28 public: |
| 25 ActiveStateManagerObserver() {} | 29 ActiveStateManagerObserver() {} |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 EXPECT_CALL(observer, WillBeDestroyed()).Times(1); | 75 EXPECT_CALL(observer, WillBeDestroyed()).Times(1); |
| 72 | 76 |
| 73 active_state_manager->SetActive(true); | 77 active_state_manager->SetActive(true); |
| 74 active_state_manager->SetActive(false); | 78 active_state_manager->SetActive(false); |
| 75 // There is no need to explicitly remove the observer since it is removed when | 79 // There is no need to explicitly remove the observer since it is removed when |
| 76 // |active_state_manager| goes away -- which happens when |browser_state| goes | 80 // |active_state_manager| goes away -- which happens when |browser_state| goes |
| 77 // away. | 81 // away. |
| 78 } | 82 } |
| 79 | 83 |
| 80 } // namespace web | 84 } // namespace web |
| OLD | NEW |