Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: chrome/browser/extensions/api/socket/socket_api_unittest.cc

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/values.h" 5 #include "base/values.h"
6 #include "chrome/browser/browser_process_impl.h" 6 #include "chrome/browser/browser_process_impl.h"
7 #include "chrome/browser/extensions/api/socket/socket_api.h" 7 #include "chrome/browser/extensions/api/socket/socket_api.h"
8 #include "chrome/browser/extensions/extension_function_test_utils.h" 8 #include "chrome/browser/extensions/extension_function_test_utils.h"
9 #include "chrome/browser/extensions/test_extension_system.h" 9 #include "chrome/browser/extensions/test_extension_system.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
11 #include "chrome/test/base/browser_with_test_window_test.h" 11 #include "chrome/test/base/browser_with_test_window_test.h"
12 #include "chrome/test/base/testing_browser_process.h" 12 #include "chrome/test/base/testing_browser_process.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace utils = extension_function_test_utils; 16 namespace utils = extension_function_test_utils;
17 17
18 namespace extensions { 18 namespace extensions {
19 19
20 class SocketUnitTest : public BrowserWithTestWindowTest { 20 class SocketUnitTest : public BrowserWithTestWindowTest {
21 public: 21 public:
22 virtual void SetUp() { 22 virtual void SetUp() {
23 BrowserWithTestWindowTest::SetUp(); 23 BrowserWithTestWindowTest::SetUp();
24 24
25 TestExtensionSystem* system = static_cast<TestExtensionSystem*>( 25 TestExtensionSystem* system = static_cast<TestExtensionSystem*>(
26 ExtensionSystem::Get(browser()->profile())); 26 ExtensionSystem::Get(browser()->profile()));
27 system->CreateSocketManager(); 27 system->CreateSocketManager();
28 28
29 extension_ = utils::CreateEmptyExtensionWithLocation( 29 extension_ = utils::CreateEmptyExtensionWithLocation(
30 extensions::Extension::LOAD); 30 extensions::Manifest::LOAD);
31 } 31 }
32 32
33 base::Value* RunFunctionWithExtension( 33 base::Value* RunFunctionWithExtension(
34 UIThreadExtensionFunction* function, const std::string& args) { 34 UIThreadExtensionFunction* function, const std::string& args) {
35 scoped_refptr<UIThreadExtensionFunction> delete_function(function); 35 scoped_refptr<UIThreadExtensionFunction> delete_function(function);
36 function->set_extension(extension_.get()); 36 function->set_extension(extension_.get());
37 return utils::RunFunctionAndReturnSingleResult(function, args, browser()); 37 return utils::RunFunctionAndReturnSingleResult(function, args, browser());
38 } 38 }
39 39
40 base::DictionaryValue* RunFunctionAndReturnDict( 40 base::DictionaryValue* RunFunctionAndReturnDict(
(...skipping 12 matching lines...) Expand all
53 // this CL landed was hard enough already, so we're going to save this work 53 // this CL landed was hard enough already, so we're going to save this work
54 // for another day. 54 // for another day.
55 if (false) { 55 if (false) {
56 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDict( 56 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDict(
57 new SocketCreateFunction(), "[\"tcp\"]")); 57 new SocketCreateFunction(), "[\"tcp\"]"));
58 ASSERT_TRUE(result.get()); 58 ASSERT_TRUE(result.get());
59 } 59 }
60 } 60 }
61 61
62 } // namespace extensions 62 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698