OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tcp_socket.h" | 13 #include "extensions/browser/api/socket/tcp_socket.h" |
14 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h" | 14 #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 namespace core_api { | 19 namespace core_api { |
20 | 20 |
21 static BrowserContextKeyedService* ApiResourceManagerTestFactory( | 21 static KeyedService* ApiResourceManagerTestFactory( |
22 content::BrowserContext* context) { | 22 content::BrowserContext* context) { |
23 content::BrowserThread::ID id; | 23 content::BrowserThread::ID id; |
24 CHECK(content::BrowserThread::GetCurrentThreadIdentifier(&id)); | 24 CHECK(content::BrowserThread::GetCurrentThreadIdentifier(&id)); |
25 return ApiResourceManager< | 25 return ApiResourceManager< |
26 ResumableTCPSocket>::CreateApiResourceManagerForTest(context, id); | 26 ResumableTCPSocket>::CreateApiResourceManagerForTest(context, id); |
27 } | 27 } |
28 | 28 |
29 class SocketsTcpUnitTest : public ExtensionApiUnittest { | 29 class SocketsTcpUnitTest : public ExtensionApiUnittest { |
30 public: | 30 public: |
31 virtual void SetUp() { | 31 virtual void SetUp() { |
(...skipping 15 matching lines...) Expand all Loading... |
47 function->set_work_thread_id(id); | 47 function->set_work_thread_id(id); |
48 | 48 |
49 // Run tests | 49 // Run tests |
50 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary( | 50 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary( |
51 function, "[{\"persistent\": true, \"name\": \"foo\"}]")); | 51 function, "[{\"persistent\": true, \"name\": \"foo\"}]")); |
52 ASSERT_TRUE(result.get()); | 52 ASSERT_TRUE(result.get()); |
53 } | 53 } |
54 | 54 |
55 } // namespace core_api | 55 } // namespace core_api |
56 } // namespace extensions | 56 } // namespace extensions |
OLD | NEW |