OLD | NEW |
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/extension_api_unittest.h" | 7 #include "chrome/browser/extensions/extension_api_unittest.h" |
8 #include "chrome/browser/extensions/test_extension_system.h" | 8 #include "chrome/browser/extensions/test_extension_system.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/test/base/testing_browser_process.h" | 10 #include "chrome/test/base/testing_browser_process.h" |
11 #include "extensions/browser/api/api_resource_manager.h" | 11 #include "extensions/browser/api/api_resource_manager.h" |
12 #include "extensions/browser/api/socket/socket.h" | 12 #include "extensions/browser/api/socket/socket.h" |
13 #include "extensions/browser/api/socket/socket_api.h" | 13 #include "extensions/browser/api/socket/socket_api.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 BrowserContextKeyedService* ApiResourceManagerTestFactory( | 19 KeyedService* ApiResourceManagerTestFactory(content::BrowserContext* context) { |
20 content::BrowserContext* context) { | |
21 content::BrowserThread::ID id; | 20 content::BrowserThread::ID id; |
22 CHECK(content::BrowserThread::GetCurrentThreadIdentifier(&id)); | 21 CHECK(content::BrowserThread::GetCurrentThreadIdentifier(&id)); |
23 return ApiResourceManager<Socket>::CreateApiResourceManagerForTest(context, | 22 return ApiResourceManager<Socket>::CreateApiResourceManagerForTest(context, |
24 id); | 23 id); |
25 } | 24 } |
26 | 25 |
27 class SocketUnitTest : public ExtensionApiUnittest { | 26 class SocketUnitTest : public ExtensionApiUnittest { |
28 public: | 27 public: |
29 virtual void SetUp() { | 28 virtual void SetUp() { |
30 ExtensionApiUnittest::SetUp(); | 29 ExtensionApiUnittest::SetUp(); |
(...skipping 12 matching lines...) Expand all Loading... |
43 SocketCreateFunction* function = new SocketCreateFunction(); | 42 SocketCreateFunction* function = new SocketCreateFunction(); |
44 function->set_work_thread_id(id); | 43 function->set_work_thread_id(id); |
45 | 44 |
46 // Run tests | 45 // Run tests |
47 scoped_ptr<base::DictionaryValue> result( | 46 scoped_ptr<base::DictionaryValue> result( |
48 RunFunctionAndReturnDictionary(function, "[\"tcp\"]")); | 47 RunFunctionAndReturnDictionary(function, "[\"tcp\"]")); |
49 ASSERT_TRUE(result.get()); | 48 ASSERT_TRUE(result.get()); |
50 } | 49 } |
51 | 50 |
52 } // namespace extensions | 51 } // namespace extensions |
OLD | NEW |