OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "third_party/libaddressinput/chromium/chrome_metadata_source.h" | 5 #include "third_party/libaddressinput/chromium/chrome_metadata_source.h" |
6 | 6 |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
8 #include "net/url_request/test_url_fetcher_factory.h" | 8 #include "net/url_request/test_url_fetcher_factory.h" |
9 #include "net/url_request/url_request_test_util.h" | 9 #include "net/url_request/url_request_test_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace autofill { | 12 namespace autofill { |
13 | 13 |
14 static const char kFakeUrl[] = "https://example.com"; | 14 static const char kFakeUrl[] = "https://example.com"; |
15 static const char kFakeInsecureUrl[] = "http://example.com"; | 15 static const char kFakeInsecureUrl[] = "http://example.com"; |
16 | 16 |
17 class ChromeMetadataSourceTest : public testing::Test { | 17 class ChromeMetadataSourceTest : public testing::Test { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 TEST_F(ChromeMetadataSourceTest, RejectsInsecureScheme) { | 91 TEST_F(ChromeMetadataSourceTest, RejectsInsecureScheme) { |
92 const char kFakePayload[] = "ham hock"; | 92 const char kFakePayload[] = "ham hock"; |
93 set_url(GURL(kFakeInsecureUrl)); | 93 set_url(GURL(kFakeInsecureUrl)); |
94 SetFakeResponse(kFakePayload, net::HTTP_OK); | 94 SetFakeResponse(kFakePayload, net::HTTP_OK); |
95 Get(); | 95 Get(); |
96 EXPECT_FALSE(success()); | 96 EXPECT_FALSE(success()); |
97 EXPECT_TRUE(!has_data() || data().empty()); | 97 EXPECT_TRUE(!has_data() || data().empty()); |
98 } | 98 } |
99 | 99 |
100 } // namespace autofill | 100 } // namespace autofill |
OLD | NEW |