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 "components/domain_reliability/uploader.h" | 5 #include "components/domain_reliability/uploader.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
12 #include "components/domain_reliability/test_util.h" | 12 #include "components/domain_reliability/test_util.h" |
13 #include "content/public/test/test_browser_thread_bundle.h" | 13 #include "content/public/test/test_browser_thread_bundle.h" |
| 14 #include "net/base/load_flags.h" |
14 #include "net/url_request/test_url_fetcher_factory.h" | 15 #include "net/url_request/test_url_fetcher_factory.h" |
15 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
16 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
17 #include "net/url_request/url_request_test_util.h" | 18 #include "net/url_request/url_request_test_util.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 namespace domain_reliability { | 21 namespace domain_reliability { |
21 namespace { | 22 namespace { |
22 | 23 |
23 class DomainReliabilityUploaderTest : public testing::Test { | 24 class DomainReliabilityUploaderTest : public testing::Test { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 fetcher->SetResponseString(""); | 104 fetcher->SetResponseString(""); |
104 | 105 |
105 EXPECT_FALSE(upload_complete_[0]); | 106 EXPECT_FALSE(upload_complete_[0]); |
106 fetcher->delegate()->OnURLFetchComplete(fetcher); | 107 fetcher->delegate()->OnURLFetchComplete(fetcher); |
107 EXPECT_TRUE(upload_complete_[0]); | 108 EXPECT_TRUE(upload_complete_[0]); |
108 EXPECT_FALSE(upload_successful_[0]); | 109 EXPECT_FALSE(upload_successful_[0]); |
109 } | 110 } |
110 | 111 |
111 } // namespace | 112 } // namespace |
112 } // namespace domain_reliability | 113 } // namespace domain_reliability |
OLD | NEW |