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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
| 7 #include "components/invalidation/gcm_network_channel.h" |
7 #include "google_apis/gaia/google_service_auth_error.h" | 8 #include "google_apis/gaia/google_service_auth_error.h" |
8 #include "net/url_request/test_url_fetcher_factory.h" | 9 #include "net/url_request/test_url_fetcher_factory.h" |
9 #include "net/url_request/url_request_test_util.h" | 10 #include "net/url_request/url_request_test_util.h" |
10 #include "sync/notifier/gcm_network_channel.h" | |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace syncer { | 13 namespace syncer { |
14 | 14 |
15 class TestGCMNetworkChannelDelegate : public GCMNetworkChannelDelegate { | 15 class TestGCMNetworkChannelDelegate : public GCMNetworkChannelDelegate { |
16 public: | 16 public: |
17 TestGCMNetworkChannelDelegate() | 17 TestGCMNetworkChannelDelegate() |
18 : register_call_count_(0) {} | 18 : register_call_count_(0) {} |
19 | 19 |
20 virtual void Initialize() OVERRIDE {} | 20 virtual void Initialize() OVERRIDE {} |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 delegate()->request_token_callback.Run( | 485 delegate()->request_token_callback.Run( |
486 GoogleServiceAuthError::AuthErrorNone(), "access.token"); | 486 GoogleServiceAuthError::AuthErrorNone(), "access.token"); |
487 RunLoopUntilIdle(); | 487 RunLoopUntilIdle(); |
488 EXPECT_EQ(url_fetchers_created_count(), 3); | 488 EXPECT_EQ(url_fetchers_created_count(), 3); |
489 // Echo_token should be from second message. | 489 // Echo_token should be from second message. |
490 EXPECT_EQ("echo.token", get_last_echo_token()); | 490 EXPECT_EQ("echo.token", get_last_echo_token()); |
491 } | 491 } |
492 #endif | 492 #endif |
493 | 493 |
494 } // namespace syncer | 494 } // namespace syncer |
OLD | NEW |