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

Side by Side Diff: components/gcm_driver/instance_id/instance_id_driver_unittest.cc

Issue 1231673010: Delete message loops from gcm unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/gcm_driver/instance_id/instance_id_driver.h" 5 #include "components/gcm_driver/instance_id/instance_id_driver.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 9 #include "base/run_loop.h"
11 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
12 #include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h" 11 #include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h"
13 #include "components/gcm_driver/instance_id/instance_id.h" 12 #include "components/gcm_driver/instance_id/instance_id.h"
14 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
15 14
16 namespace instance_id { 15 namespace instance_id {
17 16
18 namespace { 17 namespace {
19 18
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 69
71 InstanceIDDriver* driver() const { return driver_.get(); } 70 InstanceIDDriver* driver() const { return driver_.get(); }
72 71
73 private: 72 private:
74 void GetIDCompleted(const std::string& id); 73 void GetIDCompleted(const std::string& id);
75 void GetCreationTimeCompleted(const base::Time& creation_time); 74 void GetCreationTimeCompleted(const base::Time& creation_time);
76 void DeleteIDCompleted(InstanceID::Result result); 75 void DeleteIDCompleted(InstanceID::Result result);
77 void GetTokenCompleted(const std::string& token, InstanceID::Result result); 76 void GetTokenCompleted(const std::string& token, InstanceID::Result result);
78 void DeleteTokenCompleted(InstanceID::Result result); 77 void DeleteTokenCompleted(InstanceID::Result result);
79 78
80 base::MessageLoopForUI message_loop_;
81 scoped_ptr<FakeGCMDriverForInstanceID> gcm_driver_; 79 scoped_ptr<FakeGCMDriverForInstanceID> gcm_driver_;
82 scoped_ptr<InstanceIDDriver> driver_; 80 scoped_ptr<InstanceIDDriver> driver_;
83 81
84 std::string id_; 82 std::string id_;
85 base::Time creation_time_; 83 base::Time creation_time_;
86 std::string token_; 84 std::string token_;
87 InstanceID::Result result_; 85 InstanceID::Result result_;
88 86
89 bool async_operation_completed_; 87 bool async_operation_completed_;
90 base::Closure async_operation_completed_callback_; 88 base::Closure async_operation_completed_callback_;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 GetToken(instance_id, kAuthorizedEntity1, kScope2, options); 345 GetToken(instance_id, kAuthorizedEntity1, kScope2, options);
348 EXPECT_FALSE(new_token1.empty()); 346 EXPECT_FALSE(new_token1.empty());
349 EXPECT_NE(token1, new_token1); 347 EXPECT_NE(token1, new_token1);
350 348
351 // The other token is not affected by the deletion. 349 // The other token is not affected by the deletion.
352 EXPECT_EQ(token2, 350 EXPECT_EQ(token2,
353 GetToken(instance_id, kAuthorizedEntity2, kScope1, options)); 351 GetToken(instance_id, kAuthorizedEntity2, kScope1, options));
354 } 352 }
355 353
356 } // instance_id 354 } // instance_id
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698