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

Side by Side Diff: chrome/browser/extensions/api/streams_private/streams_private_apitest.cc

Issue 14365019: Break dependencies preventing move of test_server down to net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "chrome/browser/download/download_prefs.h" 7 #include "chrome/browser/download/download_prefs.h"
8 #include "chrome/browser/extensions/event_router.h" 8 #include "chrome/browser/extensions/event_router.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/extension_info_map.h" 10 #include "chrome/browser/extensions/extension_info_map.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // extension to have MIME type 'application/msword' and the resources that 87 // extension to have MIME type 'application/msword' and the resources that
88 // should be downloaded by the browser to have MIME type 'plain/text'. 88 // should be downloaded by the browser to have MIME type 'plain/text'.
89 class StreamsPrivateApiTest : public ExtensionApiTest { 89 class StreamsPrivateApiTest : public ExtensionApiTest {
90 public: 90 public:
91 StreamsPrivateApiTest() {} 91 StreamsPrivateApiTest() {}
92 92
93 virtual ~StreamsPrivateApiTest() {} 93 virtual ~StreamsPrivateApiTest() {}
94 94
95 virtual void SetUpOnMainThread() OVERRIDE { 95 virtual void SetUpOnMainThread() OVERRIDE {
96 // Init test server. 96 // Init test server.
97 test_server_.reset(new HttpServer()); 97 test_server_.reset(new HttpServer(
98 test_server_->InitializeAndWaitUntilReady(); 98 content::BrowserThread::GetMessageLoopProxyForThread(
99 content::BrowserThread::IO)));
100 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady());
99 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); 101 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest));
100 102
101 ExtensionApiTest::SetUpOnMainThread(); 103 ExtensionApiTest::SetUpOnMainThread();
102 } 104 }
103 105
104 virtual void CleanUpOnMainThread() OVERRIDE { 106 virtual void CleanUpOnMainThread() OVERRIDE {
105 // Tear down the test server. 107 // Tear down the test server.
106 test_server_->ShutdownAndWaitUntilComplete(); 108 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete());
107 test_server_.reset(); 109 test_server_.reset();
108 ExtensionApiTest::CleanUpOnMainThread(); 110 ExtensionApiTest::CleanUpOnMainThread();
109 } 111 }
110 112
111 void InitializeDownloadSettings() { 113 void InitializeDownloadSettings() {
112 ASSERT_TRUE(browser()); 114 ASSERT_TRUE(browser());
113 ASSERT_TRUE(downloads_dir_.CreateUniqueTempDir()); 115 ASSERT_TRUE(downloads_dir_.CreateUniqueTempDir());
114 116
115 // Setup default downloads directory to the scoped tmp directory created for 117 // Setup default downloads directory to the scoped tmp directory created for
116 // the test. 118 // the test.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // The test extension should not receive any events by now. Send it an event 305 // The test extension should not receive any events by now. Send it an event
304 // with MIME type "test/done", so it stops waiting for the events. (If there 306 // with MIME type "test/done", so it stops waiting for the events. (If there
305 // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will 307 // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will
306 // fail regardless of the sent event; chrome.test.notifySuccess will not be 308 // fail regardless of the sent event; chrome.test.notifySuccess will not be
307 // called by the extension). 309 // called by the extension).
308 SendDoneEvent(); 310 SendDoneEvent();
309 EXPECT_TRUE(catcher.GetNextResult()); 311 EXPECT_TRUE(catcher.GetNextResult());
310 } 312 }
311 313
312 } // namespace 314 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/oobe_browsertest.cc ('k') | chrome/browser/google_apis/base_operations_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698