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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 base::MessageLoop message_loop_; | 78 base::MessageLoop message_loop_; |
79 net::TestURLFetcherFactory url_fetcher_factory_; | 79 net::TestURLFetcherFactory url_fetcher_factory_; |
80 scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_; | 80 scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_; |
81 FakeGCMStatsRecorder recorder_; | 81 FakeGCMStatsRecorder recorder_; |
82 }; | 82 }; |
83 | 83 |
84 UnregistrationRequestTest::UnregistrationRequestTest() | 84 UnregistrationRequestTest::UnregistrationRequestTest() |
85 : callback_called_(false), | 85 : callback_called_(false), |
86 status_(UnregistrationRequest::UNREGISTRATION_STATUS_COUNT), | 86 status_(UnregistrationRequest::UNREGISTRATION_STATUS_COUNT), |
87 url_request_context_getter_(new net::TestURLRequestContextGetter( | 87 url_request_context_getter_(new net::TestURLRequestContextGetter( |
88 message_loop_.message_loop_proxy())) {} | 88 message_loop_.task_runner())) {} |
89 | 89 |
90 UnregistrationRequestTest::~UnregistrationRequestTest() {} | 90 UnregistrationRequestTest::~UnregistrationRequestTest() {} |
91 | 91 |
92 void UnregistrationRequestTest::UnregistrationCallback( | 92 void UnregistrationRequestTest::UnregistrationCallback( |
93 UnregistrationRequest::Status status) { | 93 UnregistrationRequest::Status status) { |
94 callback_called_ = true; | 94 callback_called_ = true; |
95 status_ = status; | 95 status_ = status; |
96 } | 96 } |
97 | 97 |
98 void UnregistrationRequestTest::SetResponseStatusAndString( | 98 void UnregistrationRequestTest::SetResponseStatusAndString( |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 request_->Start(); | 418 request_->Start(); |
419 | 419 |
420 SetResponseStatusAndString(net::HTTP_UNAUTHORIZED, ""); | 420 SetResponseStatusAndString(net::HTTP_UNAUTHORIZED, ""); |
421 CompleteFetch(); | 421 CompleteFetch(); |
422 | 422 |
423 EXPECT_TRUE(callback_called_); | 423 EXPECT_TRUE(callback_called_); |
424 EXPECT_EQ(UnregistrationRequest::HTTP_NOT_OK, status_); | 424 EXPECT_EQ(UnregistrationRequest::HTTP_NOT_OK, status_); |
425 } | 425 } |
426 | 426 |
427 } // namespace gcm | 427 } // namespace gcm |
OLD | NEW |