| 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 "extensions/browser/api_unittest.h" | 5 #include "extensions/browser/api_unittest.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "components/user_prefs/user_prefs.h" | 8 #include "components/user_prefs/user_prefs.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace utils = extensions::api_test_utils; | 28 namespace utils = extensions::api_test_utils; |
| 29 | 29 |
| 30 namespace extensions { | 30 namespace extensions { |
| 31 | 31 |
| 32 ApiUnitTest::ApiUnitTest() {} | 32 ApiUnitTest::ApiUnitTest() {} |
| 33 | 33 |
| 34 ApiUnitTest::~ApiUnitTest() {} | 34 ApiUnitTest::~ApiUnitTest() {} |
| 35 | 35 |
| 36 void ApiUnitTest::SetUp() { | 36 void ApiUnitTest::SetUp() { |
| 37 ExtensionsTest::SetUp(); | |
| 38 | |
| 39 thread_bundle_.reset(new content::TestBrowserThreadBundle( | 37 thread_bundle_.reset(new content::TestBrowserThreadBundle( |
| 40 content::TestBrowserThreadBundle::DEFAULT)); | 38 content::TestBrowserThreadBundle::DEFAULT)); |
| 39 |
| 41 user_prefs::UserPrefs::Set(browser_context(), &testing_pref_service_); | 40 user_prefs::UserPrefs::Set(browser_context(), &testing_pref_service_); |
| 42 | 41 |
| 42 ExtensionsTest::SetUp(); |
| 43 |
| 43 extension_ = ExtensionBuilder() | 44 extension_ = ExtensionBuilder() |
| 44 .SetManifest(DictionaryBuilder() | 45 .SetManifest(DictionaryBuilder() |
| 45 .Set("name", "Test") | 46 .Set("name", "Test") |
| 46 .Set("version", "1.0") | 47 .Set("version", "1.0") |
| 47 .Build()) | 48 .Build()) |
| 48 .SetLocation(Manifest::UNPACKED) | 49 .SetLocation(Manifest::UNPACKED) |
| 49 .Build(); | 50 .Build(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void ApiUnitTest::TearDown() { | 53 void ApiUnitTest::TearDown() { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 function->SetRenderFrameHost(contents_->GetMainFrame()); | 116 function->SetRenderFrameHost(contents_->GetMainFrame()); |
| 116 return utils::RunFunctionAndReturnError(function, args, browser_context()); | 117 return utils::RunFunctionAndReturnError(function, args, browser_context()); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void ApiUnitTest::RunFunction(UIThreadExtensionFunction* function, | 120 void ApiUnitTest::RunFunction(UIThreadExtensionFunction* function, |
| 120 const std::string& args) { | 121 const std::string& args) { |
| 121 RunFunctionAndReturnValue(function, args); | 122 RunFunctionAndReturnValue(function, args); |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // namespace extensions | 125 } // namespace extensions |
| OLD | NEW |