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

Side by Side Diff: base/message_loop/message_loop_unittest.cc

Issue 2342903002: Remove calls to deprecated MessageLoop methods from message_loop_unittest.cc. (Closed)
Patch Set: fix build error Created 4 years, 3 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 WaitableEvent test_done_event(WaitableEvent::ResetPolicy::MANUAL, 99 WaitableEvent test_done_event(WaitableEvent::ResetPolicy::MANUAL,
100 WaitableEvent::InitialState::NOT_SIGNALED); 100 WaitableEvent::InitialState::NOT_SIGNALED);
101 101
102 std::unique_ptr<android::JavaHandlerThreadForTesting> java_thread; 102 std::unique_ptr<android::JavaHandlerThreadForTesting> java_thread;
103 java_thread.reset(new android::JavaHandlerThreadForTesting( 103 java_thread.reset(new android::JavaHandlerThreadForTesting(
104 "JavaHandlerThreadForTesting from AbortDontRunMoreTasks", 104 "JavaHandlerThreadForTesting from AbortDontRunMoreTasks",
105 &test_done_event)); 105 &test_done_event));
106 java_thread->Start(); 106 java_thread->Start();
107 107
108 if (delayed) { 108 if (delayed) {
109 java_thread->message_loop()->PostDelayedTask( 109 java_thread->message_loop()->task_runner()->PostDelayedTask(
110 FROM_HERE, Bind(&AbortMessagePump), TimeDelta::FromMilliseconds(10)); 110 FROM_HERE, Bind(&AbortMessagePump), TimeDelta::FromMilliseconds(10));
111 } else { 111 } else {
112 java_thread->message_loop()->PostTask(FROM_HERE, Bind(&AbortMessagePump)); 112 java_thread->message_loop()->task_runner()->PostTask(
113 FROM_HERE, Bind(&AbortMessagePump));
113 } 114 }
114 115
115 // Wait to ensure we catch the correct exception (and don't crash) 116 // Wait to ensure we catch the correct exception (and don't crash)
116 test_done_event.Wait(); 117 test_done_event.Wait();
117 118
118 java_thread->Stop(); 119 java_thread->Stop();
119 java_thread.reset(); 120 java_thread.reset();
120 } 121 }
121 122
122 TEST(MessageLoopTest, JavaExceptionAbort) { 123 TEST(MessageLoopTest, JavaExceptionAbort) {
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 1024
1024 { 1025 {
1025 std::string kThreadName("bar"); 1026 std::string kThreadName("bar");
1026 base::Thread thread(kThreadName); 1027 base::Thread thread(kThreadName);
1027 ASSERT_TRUE(thread.StartAndWaitForTesting()); 1028 ASSERT_TRUE(thread.StartAndWaitForTesting());
1028 EXPECT_EQ(kThreadName, thread.message_loop()->GetThreadName()); 1029 EXPECT_EQ(kThreadName, thread.message_loop()->GetThreadName());
1029 } 1030 }
1030 } 1031 }
1031 1032
1032 } // namespace base 1033 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698