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 <ostream> | 5 #include <ostream> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "chrome/browser/policy/device_management_backend_impl.h" | 10 #include "chrome/browser/policy/device_management_backend_impl.h" |
11 #include "chrome/browser/policy/device_management_backend_mock.h" | 11 #include "chrome/browser/policy/device_management_backend_mock.h" |
12 #include "chrome/browser/policy/device_management_service.h" | 12 #include "chrome/browser/policy/device_management_service.h" |
13 #include "chrome/browser/policy/proto/device_management_constants.h" | 13 #include "chrome/browser/policy/proto/device_management_constants.h" |
14 #include "chrome/test/base/testing_browser_process.h" | 14 #include "chrome/test/base/testing_browser_process.h" |
15 #include "content/test/test_browser_thread.h" | 15 #include "content/test/test_browser_thread.h" |
16 #include "content/test/test_url_fetcher_factory.h" | 16 #include "content/test/test_url_fetcher_factory.h" |
17 #include "net/base/escape.h" | 17 #include "net/base/escape.h" |
18 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
20 #include "net/http/http_response_headers.h" | 20 #include "net/http/http_response_headers.h" |
21 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
22 #include "net/url_request/url_request_test_util.h" | 22 #include "net/url_request/url_request_test_util.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
| 26 using content::BrowserThread; |
26 using testing::IgnoreResult; | 27 using testing::IgnoreResult; |
27 using testing::InvokeWithoutArgs; | 28 using testing::InvokeWithoutArgs; |
28 using testing::_; | 29 using testing::_; |
29 | 30 |
30 namespace policy { | 31 namespace policy { |
31 | 32 |
32 const char kServiceUrl[] = "https://example.com/management_service"; | 33 const char kServiceUrl[] = "https://example.com/management_service"; |
33 | 34 |
34 // Encoded empty response messages for testing the error code paths. | 35 // Encoded empty response messages for testing the error code paths. |
35 const char kResponseEmpty[] = "\x08\x00"; | 36 const char kResponseEmpty[] = "\x08\x00"; |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 | 578 |
578 // Verify that a new URLFetcher was started that bypasses the proxy. | 579 // Verify that a new URLFetcher was started that bypasses the proxy. |
579 fetcher = factory_.GetFetcherByID(0); | 580 fetcher = factory_.GetFetcherByID(0); |
580 ASSERT_TRUE(fetcher); | 581 ASSERT_TRUE(fetcher); |
581 EXPECT_TRUE((fetcher->GetLoadFlags() & net::LOAD_BYPASS_PROXY) != 0); | 582 EXPECT_TRUE((fetcher->GetLoadFlags() & net::LOAD_BYPASS_PROXY) != 0); |
582 EXPECT_EQ(original_url, fetcher->GetOriginalURL()); | 583 EXPECT_EQ(original_url, fetcher->GetOriginalURL()); |
583 EXPECT_EQ(upload_data, fetcher->upload_data()); | 584 EXPECT_EQ(upload_data, fetcher->upload_data()); |
584 } | 585 } |
585 | 586 |
586 } // namespace policy | 587 } // namespace policy |
OLD | NEW |