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

Side by Side Diff: chrome/test/chromedriver/chrome_launcher.cc

Issue 687723006: [chromedriver] Use PortServer on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/test/chromedriver/chrome_launcher.h" 5 #include "chrome/test/chromedriver/chrome_launcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 return LaunchRemoteChromeSession( 488 return LaunchRemoteChromeSession(
489 context_getter, socket_factory, 489 context_getter, socket_factory,
490 capabilities, devtools_event_listeners, chrome); 490 capabilities, devtools_event_listeners, chrome);
491 } 491 }
492 492
493 int port = 0; 493 int port = 0;
494 scoped_ptr<PortReservation> port_reservation; 494 scoped_ptr<PortReservation> port_reservation;
495 Status port_status(kOk); 495 Status port_status(kOk);
496 496
497 if (capabilities.IsAndroid()) { 497 if (capabilities.IsAndroid()) {
498 port_status = port_manager->ReservePortFromPool(&port, &port_reservation); 498 if (port_server)
499 port_status = port_server->ReservePort(&port, &port_reservation);
500 else
501 port_status = port_manager->ReservePortFromPool(&port, &port_reservation);
499 if (port_status.IsError()) 502 if (port_status.IsError())
500 return Status(kUnknownError, "cannot reserve port for Chrome", 503 return Status(kUnknownError, "cannot reserve port for Chrome",
501 port_status); 504 port_status);
502 return LaunchAndroidChrome(context_getter, 505 return LaunchAndroidChrome(context_getter,
503 port, 506 port,
504 port_reservation.Pass(), 507 port_reservation.Pass(),
505 socket_factory, 508 socket_factory,
506 capabilities, 509 capabilities,
507 devtools_event_listeners, 510 devtools_event_listeners,
508 device_manager, 511 device_manager,
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 // Write empty "First Run" file, otherwise Chrome will wipe the default 814 // Write empty "First Run" file, otherwise Chrome will wipe the default
812 // profile that was written. 815 // profile that was written.
813 if (base::WriteFile( 816 if (base::WriteFile(
814 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { 817 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) {
815 return Status(kUnknownError, "failed to write first run file"); 818 return Status(kUnknownError, "failed to write first run file");
816 } 819 }
817 return Status(kOk); 820 return Status(kOk);
818 } 821 }
819 822
820 } // namespace internal 823 } // namespace internal
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