| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Tests for the top plugins to catch regressions in our plugin host code, as | 5 // Tests for the top plugins to catch regressions in our plugin host code, as |
| 6 // well as in the out of process code. Currently this tests: | 6 // well as in the out of process code. Currently this tests: |
| 7 // Flash | 7 // Flash |
| 8 // Real | 8 // Real |
| 9 // QuickTime | 9 // QuickTime |
| 10 // Windows Media Player | 10 // Windows Media Player |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 initial_download_path_ = PluginTest::GetTestUrl("flash.html", "", false); | 291 initial_download_path_ = PluginTest::GetTestUrl("flash.html", "", false); |
| 292 download_helper_ = new PluginDownloadUrlHelper( | 292 download_helper_ = new PluginDownloadUrlHelper( |
| 293 initial_download_path_.spec(), NULL, | 293 initial_download_path_.spec(), NULL, |
| 294 static_cast<PluginDownloadUrlHelper::DownloadDelegate*>(this)); | 294 static_cast<PluginDownloadUrlHelper::DownloadDelegate*>(this)); |
| 295 TestURLRequestContextGetter* context_getter = | 295 TestURLRequestContextGetter* context_getter = |
| 296 new TestURLRequestContextGetter; | 296 new TestURLRequestContextGetter; |
| 297 download_helper_->InitiateDownload(context_getter, | 297 download_helper_->InitiateDownload(context_getter, |
| 298 context_getter->GetIOMessageLoopProxy()); | 298 context_getter->GetIOMessageLoopProxy()); |
| 299 | 299 |
| 300 MessageLoop::current()->PostDelayedTask( | 300 MessageLoop::current()->PostDelayedTask( |
| 301 FROM_HERE, new MessageLoop::QuitTask, | 301 FROM_HERE, MessageLoop::QuitClosure, |
| 302 TestTimeouts::action_max_timeout_ms()); | 302 TestTimeouts::action_max_timeout_ms()); |
| 303 } | 303 } |
| 304 | 304 |
| 305 virtual void OnDownloadCompleted(const FilePath& download_path, | 305 virtual void OnDownloadCompleted(const FilePath& download_path, |
| 306 bool success) { | 306 bool success) { |
| 307 success_ = success; | 307 success_ = success; |
| 308 final_download_path_ = download_path; | 308 final_download_path_ = download_path; |
| 309 MessageLoop::current()->Quit(); | 309 MessageLoop::current()->Quit(); |
| 310 download_helper_ = NULL; | 310 download_helper_ = NULL; |
| 311 } | 311 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 334 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { | 334 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { |
| 335 MessageLoop loop(MessageLoop::TYPE_IO); | 335 MessageLoop loop(MessageLoop::TYPE_IO); |
| 336 Start(); | 336 Start(); |
| 337 loop.Run(); | 337 loop.Run(); |
| 338 | 338 |
| 339 EXPECT_TRUE(success()); | 339 EXPECT_TRUE(success()); |
| 340 EXPECT_TRUE(initial_download_path().BaseName().value() == | 340 EXPECT_TRUE(initial_download_path().BaseName().value() == |
| 341 final_download_path().BaseName().value()); | 341 final_download_path().BaseName().value()); |
| 342 } | 342 } |
| 343 #endif // defined(OS_WIN) | 343 #endif // defined(OS_WIN) |
| OLD | NEW |