| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chrome/browser/policy/cloud_policy_constants.h" | 8 #include "chrome/browser/policy/cloud_policy_constants.h" |
| 9 #include "chrome/browser/policy/device_management_service.h" | 9 #include "chrome/browser/policy/device_management_service.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| 11 #include "content/public/common/url_fetcher.h" | |
| 12 #include "net/base/upload_data.h" | 11 #include "net/base/upload_data.h" |
| 13 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
| 13 #include "net/url_request/url_fetcher.h" |
| 14 #include "net/url_request/url_request.h" | 14 #include "net/url_request/url_request.h" |
| 15 #include "net/url_request/url_request_test_job.h" | 15 #include "net/url_request/url_request_test_job.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 using testing::DoAll; | 19 using testing::DoAll; |
| 20 using testing::Invoke; | 20 using testing::Invoke; |
| 21 using testing::InvokeWithoutArgs; | 21 using testing::InvokeWithoutArgs; |
| 22 using testing::_; | 22 using testing::_; |
| 23 | 23 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 class DeviceManagementServiceIntegrationTest | 88 class DeviceManagementServiceIntegrationTest |
| 89 : public InProcessBrowserTest, | 89 : public InProcessBrowserTest, |
| 90 public testing::WithParamInterface< | 90 public testing::WithParamInterface< |
| 91 std::string (DeviceManagementServiceIntegrationTest::*)(void)> { | 91 std::string (DeviceManagementServiceIntegrationTest::*)(void)> { |
| 92 public: | 92 public: |
| 93 MOCK_METHOD2(OnJobDone, void(DeviceManagementStatus, | 93 MOCK_METHOD2(OnJobDone, void(DeviceManagementStatus, |
| 94 const em::DeviceManagementResponse&)); | 94 const em::DeviceManagementResponse&)); |
| 95 | 95 |
| 96 std::string InitCannedResponse() { | 96 std::string InitCannedResponse() { |
| 97 content::URLFetcher::SetEnableInterceptionForTests(true); | 97 net::URLFetcher::SetEnableInterceptionForTests(true); |
| 98 interceptor_.reset(new CannedResponseInterceptor(GURL(kServiceUrl))); | 98 interceptor_.reset(new CannedResponseInterceptor(GURL(kServiceUrl))); |
| 99 return kServiceUrl; | 99 return kServiceUrl; |
| 100 } | 100 } |
| 101 | 101 |
| 102 std::string InitTestServer() { | 102 std::string InitTestServer() { |
| 103 StartTestServer(); | 103 StartTestServer(); |
| 104 return test_server_->GetURL("device_management").spec(); | 104 return test_server_->GetURL("device_management").spec(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 protected: | 107 protected: |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 MessageLoop::current()->Run(); | 206 MessageLoop::current()->Run(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 INSTANTIATE_TEST_CASE_P( | 209 INSTANTIATE_TEST_CASE_P( |
| 210 DeviceManagementServiceIntegrationTestInstance, | 210 DeviceManagementServiceIntegrationTestInstance, |
| 211 DeviceManagementServiceIntegrationTest, | 211 DeviceManagementServiceIntegrationTest, |
| 212 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, | 212 testing::Values(&DeviceManagementServiceIntegrationTest::InitCannedResponse, |
| 213 &DeviceManagementServiceIntegrationTest::InitTestServer)); | 213 &DeviceManagementServiceIntegrationTest::InitTestServer)); |
| 214 | 214 |
| 215 } // namespace policy | 215 } // namespace policy |
| OLD | NEW |