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

Side by Side Diff: chrome/browser/devtools/device/port_forwarding_browsertest.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/location.h"
7 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/single_thread_task_runner.h"
8 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/thread_task_runner_handle.h"
9 #include "chrome/browser/devtools/device/devtools_android_bridge.h" 12 #include "chrome/browser/devtools/device/devtools_android_bridge.h"
10 #include "chrome/browser/devtools/device/self_device_provider.h" 13 #include "chrome/browser/devtools/device/self_device_provider.h"
11 #include "chrome/browser/devtools/remote_debugging_server.h" 14 #include "chrome/browser/devtools/remote_debugging_server.h"
12 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
15 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
17 #include "chrome/test/base/in_process_browser_test.h" 20 #include "chrome/test/base/in_process_browser_test.h"
18 #include "chrome/test/base/ui_test_utils.h" 21 #include "chrome/test/base/ui_test_utils.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 54 }
52 55
53 ~Listener() override { 56 ~Listener() override {
54 DevToolsAndroidBridge::Factory::GetForProfile(profile_)-> 57 DevToolsAndroidBridge::Factory::GetForProfile(profile_)->
55 RemovePortForwardingListener(this); 58 RemovePortForwardingListener(this);
56 } 59 }
57 60
58 void PortStatusChanged(const ForwardingStatus& status) override { 61 void PortStatusChanged(const ForwardingStatus& status) override {
59 if (status.empty() && skip_empty_devices_) 62 if (status.empty() && skip_empty_devices_)
60 return; 63 return;
61 base::MessageLoop::current()->PostTask( 64 base::ThreadTaskRunnerHandle::Get()->PostTask(
62 FROM_HERE, base::MessageLoop::QuitClosure()); 65 FROM_HERE, base::MessageLoop::QuitClosure());
63 } 66 }
64 67
65 void set_skip_empty_devices(bool skip_empty_devices) { 68 void set_skip_empty_devices(bool skip_empty_devices) {
66 skip_empty_devices_ = skip_empty_devices; 69 skip_empty_devices_ = skip_empty_devices;
67 } 70 }
68 71
69 private: 72 private:
70 Profile* profile_; 73 Profile* profile_;
71 bool skip_empty_devices_; 74 bool skip_empty_devices_;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 content::RunMessageLoop(); 175 content::RunMessageLoop();
173 176
174 self_provider->set_release_callback_for_test( 177 self_provider->set_release_callback_for_test(
175 base::Bind(&base::MessageLoop::PostTask, 178 base::Bind(&base::MessageLoop::PostTask,
176 base::Unretained(base::MessageLoop::current()), 179 base::Unretained(base::MessageLoop::current()),
177 FROM_HERE, 180 FROM_HERE,
178 base::MessageLoop::QuitClosure())); 181 base::MessageLoop::QuitClosure()));
179 wait_for_port_forwarding.reset(); 182 wait_for_port_forwarding.reset();
180 content::RunMessageLoop(); 183 content::RunMessageLoop();
181 } 184 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/android_web_socket.cc ('k') | chrome/browser/devtools/device/self_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698