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

Side by Side Diff: chrome/browser/google_apis/operation_registry_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/google_apis/operation_registry.h" 5 #include "chrome/browser/google_apis/operation_registry.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/google_apis/operation_registry.h" 10 #include "chrome/browser/google_apis/operation_registry.h"
(...skipping 23 matching lines...) Expand all
34 using OperationRegistry::Operation::NotifyResume; 34 using OperationRegistry::Operation::NotifyResume;
35 }; 35 };
36 36
37 } // namespace 37 } // namespace
38 38
39 class OperationRegistryTest : public testing::Test { 39 class OperationRegistryTest : public testing::Test {
40 protected: 40 protected:
41 OperationRegistryTest() 41 OperationRegistryTest()
42 : ui_thread_(content::BrowserThread::UI, &message_loop_) { 42 : ui_thread_(content::BrowserThread::UI, &message_loop_) {
43 } 43 }
44 MessageLoopForUI message_loop_; 44 base::MessageLoopForUI message_loop_;
45 content::TestBrowserThread ui_thread_; 45 content::TestBrowserThread ui_thread_;
46 }; 46 };
47 47
48 TEST_F(OperationRegistryTest, OneSuccess) { 48 TEST_F(OperationRegistryTest, OneSuccess) {
49 OperationRegistry registry; 49 OperationRegistry registry;
50 50
51 base::WeakPtr<MockOperation> op1 = 51 base::WeakPtr<MockOperation> op1 =
52 (new MockOperation(&registry))->AsWeakPtr(); 52 (new MockOperation(&registry))->AsWeakPtr();
53 EXPECT_CALL(*op1, DoCancel()).Times(0); 53 EXPECT_CALL(*op1, DoCancel()).Times(0);
54 54
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 base::WeakPtr<MockOperation> op2 = 125 base::WeakPtr<MockOperation> op2 =
126 (new MockOperation(&registry))->AsWeakPtr(); 126 (new MockOperation(&registry))->AsWeakPtr();
127 EXPECT_CALL(*op2, DoCancel()).Times(1); 127 EXPECT_CALL(*op2, DoCancel()).Times(1);
128 128
129 op2->NotifyResume(); 129 op2->NotifyResume();
130 EXPECT_EQ(NULL, op2.get()); // deleted 130 EXPECT_EQ(NULL, op2.get()); // deleted
131 } 131 }
132 132
133 } // namespace google_apis 133 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_operations_unittest.cc ('k') | chrome/browser/google_apis/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698