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

Unified Diff: sync/test/fake_server/run_sync_fake_server.cc

Issue 264773007: Remove Sync FakeServer standalone executable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/test/fake_server/fake_sync_server_http_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_server/run_sync_fake_server.cc
diff --git a/sync/test/fake_server/run_sync_fake_server.cc b/sync/test/fake_server/run_sync_fake_server.cc
deleted file mode 100644
index 9ded029677bad98e4a6b6eccb174cd1f89cbfb67..0000000000000000000000000000000000000000
--- a/sync/test/fake_server/run_sync_fake_server.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <iostream>
-
-#include "base/at_exit.h"
-#include "base/bind.h"
-#include "base/command_line.h"
-#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_loop_proxy.h"
-#include "base/strings/string_number_conversions.h"
-#include "sync/test/fake_server/fake_sync_server_http_handler.h"
-
-const char kPortNumberSwitch[] = "port";
-
-// This runs a FakeSyncServerHttpHandler as a command-line app.
-int main(int argc, char* argv[]) {
- using fake_server::FakeSyncServerHttpHandler;
-
- CommandLine::Init(argc, argv);
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- logging::LoggingSettings settings;
- settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
- logging::InitLogging(settings);
-
- FakeSyncServerHttpHandler* server;
-
- // Check if a port was specified on the command line
- if (command_line->HasSwitch(kPortNumberSwitch)) {
- std::string requested_port =
- command_line->GetSwitchValueASCII(kPortNumberSwitch);
- int port;
- if (!base::StringToInt(requested_port, &port)) {
- LOG(ERROR) << "Invalid --" << kPortNumberSwitch << " specified: \""
- << requested_port << "\"";
- return -1;
- }
-
- server = new FakeSyncServerHttpHandler(port);
- } else {
- LOG(INFO) << "Selecting an avilable port. Pass --" << kPortNumberSwitch
- << "=<port number> to specify your own.";
- server = new FakeSyncServerHttpHandler();
- }
-
- base::WeakPtrFactory<FakeSyncServerHttpHandler> server_ptr_factory(server);
-
- // An HttpServer must be run on a IO MessageLoop.
- base::AtExitManager exit_manager; // Debug builds demand that ExitManager
- // be initialized before MessageLoop.
- base::MessageLoop message_loop(base::MessageLoop::TYPE_IO);
- bool posted = message_loop.current()->message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&FakeSyncServerHttpHandler::Start,
- server_ptr_factory.GetWeakPtr()));
- CHECK(posted) << "Failed to start the HTTP server. PostTask returned false.";
- message_loop.current()->Run();
-
- return 0;
-}
« no previous file with comments | « sync/test/fake_server/fake_sync_server_http_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698