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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 -1, | 50 -1, |
51 | 51 |
52 // Don't use initial delay unless the last request was an error. | 52 // Don't use initial delay unless the last request was an error. |
53 false, | 53 false, |
54 }; | 54 }; |
55 } // namespace | 55 } // namespace |
56 | 56 |
57 class UnregistrationRequestTest : public testing::Test { | 57 class UnregistrationRequestTest : public testing::Test { |
58 public: | 58 public: |
59 UnregistrationRequestTest(); | 59 UnregistrationRequestTest(); |
60 virtual ~UnregistrationRequestTest(); | 60 ~UnregistrationRequestTest() override; |
61 | 61 |
62 void UnregistrationCallback(UnregistrationRequest::Status status); | 62 void UnregistrationCallback(UnregistrationRequest::Status status); |
63 | 63 |
64 void CreateRequest(); | 64 void CreateRequest(); |
65 void SetResponseStatusAndString(net::HttpStatusCode status_code, | 65 void SetResponseStatusAndString(net::HttpStatusCode status_code, |
66 const std::string& response_body); | 66 const std::string& response_body); |
67 void CompleteFetch(); | 67 void CompleteFetch(); |
68 | 68 |
69 protected: | 69 protected: |
70 bool callback_called_; | 70 bool callback_called_; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 EXPECT_FALSE(callback_called_); | 286 EXPECT_FALSE(callback_called_); |
287 | 287 |
288 SetResponseStatusAndString(net::HTTP_OK, kDeletedAppId); | 288 SetResponseStatusAndString(net::HTTP_OK, kDeletedAppId); |
289 CompleteFetch(); | 289 CompleteFetch(); |
290 | 290 |
291 EXPECT_TRUE(callback_called_); | 291 EXPECT_TRUE(callback_called_); |
292 EXPECT_EQ(UnregistrationRequest::SUCCESS, status_); | 292 EXPECT_EQ(UnregistrationRequest::SUCCESS, status_); |
293 } | 293 } |
294 | 294 |
295 } // namespace gcm | 295 } // namespace gcm |
OLD | NEW |