OLD | NEW |
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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/download/download_prefs.h" | 8 #include "chrome/browser/download/download_prefs.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 virtual void SetUpOnMainThread() OVERRIDE { | 135 virtual void SetUpOnMainThread() OVERRIDE { |
136 // Init test server. | 136 // Init test server. |
137 test_server_.reset(new EmbeddedTestServer); | 137 test_server_.reset(new EmbeddedTestServer); |
138 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); | 138 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); |
139 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); | 139 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); |
140 | 140 |
141 ExtensionApiTest::SetUpOnMainThread(); | 141 ExtensionApiTest::SetUpOnMainThread(); |
142 } | 142 } |
143 | 143 |
144 virtual void CleanUpOnMainThread() OVERRIDE { | 144 virtual void TearDownOnMainThread() OVERRIDE { |
145 // Tear down the test server. | 145 // Tear down the test server. |
146 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); | 146 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); |
147 test_server_.reset(); | 147 test_server_.reset(); |
148 ExtensionApiTest::CleanUpOnMainThread(); | 148 ExtensionApiTest::TearDownOnMainThread(); |
149 } | 149 } |
150 | 150 |
151 void InitializeDownloadSettings() { | 151 void InitializeDownloadSettings() { |
152 ASSERT_TRUE(browser()); | 152 ASSERT_TRUE(browser()); |
153 ASSERT_TRUE(downloads_dir_.CreateUniqueTempDir()); | 153 ASSERT_TRUE(downloads_dir_.CreateUniqueTempDir()); |
154 | 154 |
155 // Setup default downloads directory to the scoped tmp directory created for | 155 // Setup default downloads directory to the scoped tmp directory created for |
156 // the test. | 156 // the test. |
157 browser()->profile()->GetPrefs()->SetFilePath( | 157 browser()->profile()->GetPrefs()->SetFilePath( |
158 prefs::kDownloadDefaultDirectory, downloads_dir_.path()); | 158 prefs::kDownloadDefaultDirectory, downloads_dir_.path()); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 base::MessageLoop::current()->RunUntilIdle(); | 445 base::MessageLoop::current()->RunUntilIdle(); |
446 EXPECT_TRUE(catcher.GetNextResult()); | 446 EXPECT_TRUE(catcher.GetNextResult()); |
447 | 447 |
448 ui_test_utils::NavigateToURL(browser(), | 448 ui_test_utils::NavigateToURL(browser(), |
449 test_server_->GetURL("/abort.rtf")); | 449 test_server_->GetURL("/abort.rtf")); |
450 base::MessageLoop::current()->RunUntilIdle(); | 450 base::MessageLoop::current()->RunUntilIdle(); |
451 EXPECT_TRUE(catcher.GetNextResult()); | 451 EXPECT_TRUE(catcher.GetNextResult()); |
452 } | 452 } |
453 | 453 |
454 } // namespace | 454 } // namespace |
OLD | NEW |