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 <stdint.h> | 5 #include <stdint.h> |
6 #include <map> | 6 #include <map> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 CreateRequest(); | 190 CreateRequest(); |
191 request_->Start(); | 191 request_->Start(); |
192 | 192 |
193 SetResponse(net::HTTP_OK, "Error=INVALID_PARAMETERS"); | 193 SetResponse(net::HTTP_OK, "Error=INVALID_PARAMETERS"); |
194 CompleteFetch(); | 194 CompleteFetch(); |
195 | 195 |
196 EXPECT_TRUE(callback_called_); | 196 EXPECT_TRUE(callback_called_); |
197 EXPECT_EQ(UnregistrationRequest::INVALID_PARAMETERS, status_); | 197 EXPECT_EQ(UnregistrationRequest::INVALID_PARAMETERS, status_); |
198 } | 198 } |
199 | 199 |
| 200 TEST_F(GCMUnregistrationRequestTest, DeviceRegistrationError) { |
| 201 CreateRequest(); |
| 202 request_->Start(); |
| 203 |
| 204 SetResponse(net::HTTP_OK, "Error=PHONE_REGISTRATION_ERROR"); |
| 205 CompleteFetch(); |
| 206 |
| 207 EXPECT_TRUE(callback_called_); |
| 208 EXPECT_EQ(UnregistrationRequest::DEVICE_REGISTRATION_ERROR, status_); |
| 209 } |
| 210 |
200 TEST_F(GCMUnregistrationRequestTest, UnkwnownError) { | 211 TEST_F(GCMUnregistrationRequestTest, UnkwnownError) { |
201 CreateRequest(); | 212 CreateRequest(); |
202 request_->Start(); | 213 request_->Start(); |
203 | 214 |
204 SetResponse(net::HTTP_OK, "Error=XXX"); | 215 SetResponse(net::HTTP_OK, "Error=XXX"); |
205 CompleteFetch(); | 216 CompleteFetch(); |
206 | 217 |
207 EXPECT_TRUE(callback_called_); | 218 EXPECT_TRUE(callback_called_); |
208 EXPECT_EQ(UnregistrationRequest::UNKNOWN_ERROR, status_); | 219 EXPECT_EQ(UnregistrationRequest::UNKNOWN_ERROR, status_); |
209 } | 220 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 request_->Start(); | 456 request_->Start(); |
446 | 457 |
447 SetResponse(net::HTTP_OK, "Error=XXX"); | 458 SetResponse(net::HTTP_OK, "Error=XXX"); |
448 CompleteFetch(); | 459 CompleteFetch(); |
449 | 460 |
450 EXPECT_TRUE(callback_called_); | 461 EXPECT_TRUE(callback_called_); |
451 EXPECT_EQ(UnregistrationRequest::UNKNOWN_ERROR, status_); | 462 EXPECT_EQ(UnregistrationRequest::UNKNOWN_ERROR, status_); |
452 } | 463 } |
453 | 464 |
454 } // namespace gcm | 465 } // namespace gcm |
OLD | NEW |