OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_split.h" | 8 #include "base/string_split.h" |
9 #include "chrome/browser/policy/device_management_backend_impl.h" | 9 #include "chrome/browser/policy/device_management_backend_impl.h" |
10 #include "chrome/browser/policy/device_management_backend_mock.h" | 10 #include "chrome/browser/policy/device_management_backend_mock.h" |
11 #include "chrome/browser/policy/device_management_service.h" | 11 #include "chrome/browser/policy/device_management_service.h" |
12 #include "chrome/browser/policy/proto/device_management_constants.h" | 12 #include "chrome/browser/policy/proto/device_management_constants.h" |
| 13 #include "chrome/test/testing_browser_process.h" |
13 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
14 #include "content/test/test_url_fetcher_factory.h" | 15 #include "content/test/test_url_fetcher_factory.h" |
15 #include "net/base/escape.h" | 16 #include "net/base/escape.h" |
16 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
17 #include "net/url_request/url_request_test_util.h" | 18 #include "net/url_request/url_request_test_util.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 | 21 |
21 using testing::IgnoreResult; | 22 using testing::IgnoreResult; |
22 using testing::InvokeWithoutArgs; | 23 using testing::InvokeWithoutArgs; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void InitializeService() { | 67 void InitializeService() { |
67 service_->ScheduleInitialization(0); | 68 service_->ScheduleInitialization(0); |
68 loop_.RunAllPending(); | 69 loop_.RunAllPending(); |
69 } | 70 } |
70 | 71 |
71 TestURLFetcherFactory factory_; | 72 TestURLFetcherFactory factory_; |
72 scoped_ptr<DeviceManagementService> service_; | 73 scoped_ptr<DeviceManagementService> service_; |
73 scoped_ptr<DeviceManagementBackend> backend_; | 74 scoped_ptr<DeviceManagementBackend> backend_; |
74 | 75 |
75 private: | 76 private: |
| 77 ScopedTestingBrowserProcess browser_process_; |
| 78 |
76 MessageLoopForUI loop_; | 79 MessageLoopForUI loop_; |
77 BrowserThread ui_thread_; | 80 BrowserThread ui_thread_; |
78 BrowserThread io_thread_; | 81 BrowserThread io_thread_; |
79 }; | 82 }; |
80 | 83 |
81 struct FailedRequestParams { | 84 struct FailedRequestParams { |
82 FailedRequestParams(DeviceManagementBackend::ErrorCode expected_error, | 85 FailedRequestParams(DeviceManagementBackend::ErrorCode expected_error, |
83 net::URLRequestStatus::Status request_status, | 86 net::URLRequestStatus::Status request_status, |
84 int http_status, | 87 int http_status, |
85 const std::string& response) | 88 const std::string& response) |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 status, | 494 status, |
492 500, | 495 500, |
493 net::ResponseCookies(), | 496 net::ResponseCookies(), |
494 ""); | 497 ""); |
495 | 498 |
496 // Backend should have been reset. | 499 // Backend should have been reset. |
497 EXPECT_FALSE(backend_.get()); | 500 EXPECT_FALSE(backend_.get()); |
498 } | 501 } |
499 | 502 |
500 } // namespace policy | 503 } // namespace policy |
OLD | NEW |