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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // StreamsResourceThrottle. | 127 // StreamsResourceThrottle. |
128 // The test extension expects the resources that should be handed to the | 128 // The test extension expects the resources that should be handed to the |
129 // extension to have MIME type 'application/msword' and the resources that | 129 // extension to have MIME type 'application/msword' and the resources that |
130 // should be downloaded by the browser to have MIME type 'text/plain'. | 130 // should be downloaded by the browser to have MIME type 'text/plain'. |
131 class StreamsPrivateApiTest : public ExtensionApiTest { | 131 class StreamsPrivateApiTest : public ExtensionApiTest { |
132 public: | 132 public: |
133 StreamsPrivateApiTest() {} | 133 StreamsPrivateApiTest() {} |
134 | 134 |
135 virtual ~StreamsPrivateApiTest() {} | 135 virtual ~StreamsPrivateApiTest() {} |
136 | 136 |
137 virtual void SetUpOnMainThread() OVERRIDE { | 137 virtual void SetUpOnMainThread() override { |
138 // Init test server. | 138 // Init test server. |
139 test_server_.reset(new EmbeddedTestServer); | 139 test_server_.reset(new EmbeddedTestServer); |
140 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); | 140 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); |
141 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); | 141 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); |
142 | 142 |
143 ExtensionApiTest::SetUpOnMainThread(); | 143 ExtensionApiTest::SetUpOnMainThread(); |
144 } | 144 } |
145 | 145 |
146 virtual void TearDownOnMainThread() OVERRIDE { | 146 virtual void TearDownOnMainThread() override { |
147 // Tear down the test server. | 147 // Tear down the test server. |
148 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); | 148 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); |
149 test_server_.reset(); | 149 test_server_.reset(); |
150 ExtensionApiTest::TearDownOnMainThread(); | 150 ExtensionApiTest::TearDownOnMainThread(); |
151 } | 151 } |
152 | 152 |
153 void InitializeDownloadSettings() { | 153 void InitializeDownloadSettings() { |
154 ASSERT_TRUE(browser()); | 154 ASSERT_TRUE(browser()); |
155 ASSERT_TRUE(downloads_dir_.CreateUniqueTempDir()); | 155 ASSERT_TRUE(downloads_dir_.CreateUniqueTempDir()); |
156 | 156 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 base::MessageLoop::current()->RunUntilIdle(); | 447 base::MessageLoop::current()->RunUntilIdle(); |
448 EXPECT_TRUE(catcher.GetNextResult()); | 448 EXPECT_TRUE(catcher.GetNextResult()); |
449 | 449 |
450 ui_test_utils::NavigateToURL(browser(), | 450 ui_test_utils::NavigateToURL(browser(), |
451 test_server_->GetURL("/abort.rtf")); | 451 test_server_->GetURL("/abort.rtf")); |
452 base::MessageLoop::current()->RunUntilIdle(); | 452 base::MessageLoop::current()->RunUntilIdle(); |
453 EXPECT_TRUE(catcher.GetNextResult()); | 453 EXPECT_TRUE(catcher.GetNextResult()); |
454 } | 454 } |
455 | 455 |
456 } // namespace | 456 } // namespace |
OLD | NEW |