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

Unified Diff: chrome/test/live_sync/live_sync_test.h

Issue 2260001: Adding a TearDown() method to class LiveSyncTest. (Closed)
Patch Set: Fixing unintended whitespaces added by Visual Studio. Created 10 years, 7 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 | « no previous file | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/live_sync_test.h
diff --git a/chrome/test/live_sync/live_sync_test.h b/chrome/test/live_sync/live_sync_test.h
old mode 100644
new mode 100755
index cb117959f2421e5dee0b6cb9fbe19d674d628b6a..a9366eb6d0b55e9919177bc1ee04494e39bab8c6
--- a/chrome/test/live_sync/live_sync_test.h
+++ b/chrome/test/live_sync/live_sync_test.h
@@ -58,18 +58,34 @@ class LiveSyncTest : public InProcessBrowserTest {
InProcessBrowserTest::SetUp();
}
+ virtual void TearDown() {
+ // Allow the InProcessBrowserTest framework to perform its tear down.
+ InProcessBrowserTest::TearDown();
+
+ // Stop the local test sync server if one was used.
+ if (started_local_test_server_)
+ TearDownLocalTestServer();
+ }
+
virtual void SetUpLocalTestServer() {
bool success = server_.Start(net::TestServerLauncher::ProtoHTTP,
server_.kHostName, server_.kOKHTTPSPort,
FilePath(), FilePath(), std::wstring());
ASSERT_TRUE(success);
+ started_local_test_server_ = true;
+
CommandLine* cl = CommandLine::ForCurrentProcess();
cl->AppendSwitchWithValue(switches::kSyncServiceURL,
StringPrintf("http://%s:%d/chromiumsync", server_.kHostName,
server_.kOKHTTPSPort));
}
+ virtual void TearDownLocalTestServer() {
+ bool success = server_.Stop();
+ ASSERT_TRUE(success);
+ }
+
// Append command line flag to enable sync.
virtual void SetUpCommandLine(CommandLine* command_line) {
}
@@ -100,6 +116,7 @@ class LiveSyncTest : public InProcessBrowserTest {
scoped_ptr<net::ScopedDefaultHostResolverProc> mock_host_resolver_override_;
net::TestServerLauncher server_;
+ bool started_local_test_server_;
DISALLOW_COPY_AND_ASSIGN(LiveSyncTest);
};
« no previous file with comments | « no previous file | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698