| 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 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 ApiUnitTest::~ApiUnitTest() { | 37 ApiUnitTest::~ApiUnitTest() { |
| 38 } | 38 } |
| 39 | 39 |
| 40 void ApiUnitTest::SetUp() { | 40 void ApiUnitTest::SetUp() { |
| 41 ExtensionsTest::SetUp(); | 41 ExtensionsTest::SetUp(); |
| 42 | 42 |
| 43 thread_bundle_.reset(new content::TestBrowserThreadBundle( | 43 thread_bundle_.reset(new content::TestBrowserThreadBundle( |
| 44 content::TestBrowserThreadBundle::DEFAULT)); | 44 content::TestBrowserThreadBundle::DEFAULT)); |
| 45 user_prefs::UserPrefs::Set(browser_context(), &testing_pref_service_); | |
| 46 | 45 |
| 47 extension_ = ExtensionBuilder() | 46 extension_ = ExtensionBuilder() |
| 48 .SetManifest(DictionaryBuilder() | 47 .SetManifest(DictionaryBuilder() |
| 49 .Set("name", "Test") | 48 .Set("name", "Test") |
| 50 .Set("version", "1.0") | 49 .Set("version", "1.0") |
| 51 .Build()) | 50 .Build()) |
| 52 .SetLocation(Manifest::UNPACKED) | 51 .SetLocation(Manifest::UNPACKED) |
| 53 .Build(); | 52 .Build(); |
| 54 } | 53 } |
| 55 | 54 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 function->SetRenderFrameHost(contents_->GetMainFrame()); | 118 function->SetRenderFrameHost(contents_->GetMainFrame()); |
| 120 return utils::RunFunctionAndReturnError(function, args, browser_context()); | 119 return utils::RunFunctionAndReturnError(function, args, browser_context()); |
| 121 } | 120 } |
| 122 | 121 |
| 123 void ApiUnitTest::RunFunction(UIThreadExtensionFunction* function, | 122 void ApiUnitTest::RunFunction(UIThreadExtensionFunction* function, |
| 124 const std::string& args) { | 123 const std::string& args) { |
| 125 RunFunctionAndReturnValue(function, args); | 124 RunFunctionAndReturnValue(function, args); |
| 126 } | 125 } |
| 127 | 126 |
| 128 } // namespace extensions | 127 } // namespace extensions |
| OLD | NEW |