Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: google_apis/gcm/engine/gcm_request_test_base.cc

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: Address jianli's review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: google_apis/gcm/engine/gcm_request_test_base.cc
diff --git a/google_apis/gcm/engine/gcm_request_test_base.cc b/google_apis/gcm/engine/gcm_request_test_base.cc
index 5337f7e9819836f2979652a0926838a6ffb32c13..4968790cdb8c54321f71b31d852384196f68ad1c 100644
--- a/google_apis/gcm/engine/gcm_request_test_base.cc
+++ b/google_apis/gcm/engine/gcm_request_test_base.cc
@@ -76,6 +76,26 @@ void GCMRequestTestBase::CompleteFetch() {
fetcher->delegate()->OnURLFetchComplete(fetcher);
}
+void GCMRequestTestBase::VerifyFetcherUploadData(
+ std::map<std::string, std::string>* expected_pairs) {
+ net::TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0);
+ ASSERT_TRUE(fetcher);
+
+ // Verify data was formatted properly.
+ std::string upload_data = fetcher->upload_data();
+ base::StringTokenizer data_tokenizer(upload_data, "&=");
+ while (data_tokenizer.GetNext()) {
+ auto iter = expected_pairs->find(data_tokenizer.token());
+ ASSERT_TRUE(iter != expected_pairs->end()) << data_tokenizer.token();
+ ASSERT_TRUE(data_tokenizer.GetNext()) << data_tokenizer.token();
+ ASSERT_EQ(iter->second, data_tokenizer.token());
+ // Ensure that none of the keys appears twice.
+ expected_pairs->erase(iter);
+ }
+
+ ASSERT_EQ(0UL, expected_pairs->size());
+}
+
void GCMRequestTestBase::FastForwardToTriggerNextRetry() {
// Here we compute the maximum delay time by skipping the jitter fluctuation
// that only affects in the negative way.

Powered by Google App Engine
This is Rietveld 408576698