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_downloader_impl.h" | 5 #include "third_party/libaddressinput/chromium/chrome_downloader_impl.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.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 { |
| 13 |
12 static const char kFakeUrl[] = "http://example.com"; | 14 static const char kFakeUrl[] = "http://example.com"; |
13 | 15 |
14 class ChromeDownloaderImplTest : public testing::Test { | 16 class ChromeDownloaderImplTest : public testing::Test { |
15 public: | 17 public: |
16 ChromeDownloaderImplTest() | 18 ChromeDownloaderImplTest() |
17 : success_(false), | 19 : success_(false), |
18 fake_factory_(&factory_) {} | 20 fake_factory_(&factory_) {} |
19 virtual ~ChromeDownloaderImplTest() {} | 21 virtual ~ChromeDownloaderImplTest() {} |
20 | 22 |
21 protected: | 23 protected: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 EXPECT_EQ(kFakePayload, data()); | 70 EXPECT_EQ(kFakePayload, data()); |
69 } | 71 } |
70 | 72 |
71 TEST_F(ChromeDownloaderImplTest, Failure) { | 73 TEST_F(ChromeDownloaderImplTest, Failure) { |
72 const char kFakePayload[] = "ham hock"; | 74 const char kFakePayload[] = "ham hock"; |
73 SetFakeResponse(kFakePayload, net::HTTP_INTERNAL_SERVER_ERROR); | 75 SetFakeResponse(kFakePayload, net::HTTP_INTERNAL_SERVER_ERROR); |
74 Download(); | 76 Download(); |
75 EXPECT_FALSE(success()); | 77 EXPECT_FALSE(success()); |
76 EXPECT_EQ(std::string(), data()); | 78 EXPECT_EQ(std::string(), data()); |
77 } | 79 } |
| 80 |
| 81 } // namespace autofill |
OLD | NEW |