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 "ios/public/provider/chrome/browser/test_chrome_provider_initializer.h" | 5 #include "ios/public/provider/chrome/browser/test_chrome_provider_initializer.h" |
6 | 6 |
7 #include "ios/public/provider/chrome/browser/test_chrome_browser_provider.h" | 7 #include "ios/public/provider/chrome/browser/test_chrome_browser_provider.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
10 namespace ios { | 14 namespace ios { |
11 | 15 |
12 TestChromeProviderInitializer::TestChromeProviderInitializer() { | 16 TestChromeProviderInitializer::TestChromeProviderInitializer() { |
13 chrome_browser_provider_.reset(new TestChromeBrowserProvider()); | 17 chrome_browser_provider_.reset(new TestChromeBrowserProvider()); |
14 ios::SetChromeBrowserProvider(chrome_browser_provider_.get()); | 18 ios::SetChromeBrowserProvider(chrome_browser_provider_.get()); |
15 } | 19 } |
16 | 20 |
17 TestChromeProviderInitializer::~TestChromeProviderInitializer() { | 21 TestChromeProviderInitializer::~TestChromeProviderInitializer() { |
18 EXPECT_EQ(chrome_browser_provider_.get(), ios::GetChromeBrowserProvider()); | 22 EXPECT_EQ(chrome_browser_provider_.get(), ios::GetChromeBrowserProvider()); |
19 ios::SetChromeBrowserProvider(nullptr); | 23 ios::SetChromeBrowserProvider(nullptr); |
20 } | 24 } |
21 | 25 |
22 } // namespace ios | 26 } // namespace ios |
OLD | NEW |