Chromium Code Reviews| Index: ios/public/test/test_chrome_provider_initializer.cc |
| diff --git a/ios/public/test/test_chrome_provider_initializer.cc b/ios/public/test/test_chrome_provider_initializer.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..082a0a73bd2772bad672c0db717c75269d6d811d |
| --- /dev/null |
| +++ b/ios/public/test/test_chrome_provider_initializer.cc |
| @@ -0,0 +1,23 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ios/public/test/test_chrome_provider_initializer.h" |
| + |
| +#include "ios/public/test/test_chrome_browser_provider.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace ios { |
| + |
| +TestChromeProviderInitializer::TestChromeProviderInitializer() { |
| + chrome_browser_provider_ = new TestChromeBrowserProvider(); |
| + ios::SetChromeBrowserProvider(chrome_browser_provider_); |
| +} |
| + |
| +TestChromeProviderInitializer::~TestChromeProviderInitializer() { |
| + EXPECT_EQ(chrome_browser_provider_, ios::GetChromeBrowserProvider()); |
| + ios::SetChromeBrowserProvider(NULL); |
| + delete chrome_browser_provider_; |
|
Alexei Svitkine (slow)
2015/01/08 16:52:13
Nit: Maybe should be a scoped_ptr instead?
|
| +} |
| + |
| +} // namespace ios |