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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 public testing::Test { | 243 public testing::Test { |
244 public: | 244 public: |
245 PluginInstallerDownloadTest() | 245 PluginInstallerDownloadTest() |
246 : success_(false), | 246 : success_(false), |
247 download_helper_(NULL) {} | 247 download_helper_(NULL) {} |
248 ~PluginInstallerDownloadTest() {} | 248 ~PluginInstallerDownloadTest() {} |
249 | 249 |
250 void Start() { | 250 void Start() { |
251 initial_download_path_ = PluginTest::GetTestUrl("flash.html", false); | 251 initial_download_path_ = PluginTest::GetTestUrl("flash.html", false); |
252 download_helper_ = new PluginDownloadUrlHelper( | 252 download_helper_ = new PluginDownloadUrlHelper( |
253 initial_download_path_.spec(), base::GetCurrentProcId(), NULL, | 253 initial_download_path_.spec(), NULL, |
254 static_cast<PluginDownloadUrlHelper::DownloadDelegate*>(this)); | 254 static_cast<PluginDownloadUrlHelper::DownloadDelegate*>(this)); |
255 download_helper_->InitiateDownload(new TestURLRequestContext); | 255 download_helper_->InitiateDownload(new TestURLRequestContext); |
256 | 256 |
257 MessageLoop::current()->PostDelayedTask( | 257 MessageLoop::current()->PostDelayedTask( |
258 FROM_HERE, new MessageLoop::QuitTask, | 258 FROM_HERE, new MessageLoop::QuitTask, |
259 TestTimeouts::action_max_timeout_ms()); | 259 TestTimeouts::action_max_timeout_ms()); |
260 } | 260 } |
261 | 261 |
262 virtual void OnDownloadCompleted(const FilePath& download_path, | 262 virtual void OnDownloadCompleted(const FilePath& download_path, |
263 bool success) { | 263 bool success) { |
(...skipping 27 matching lines...) Expand all Loading... |
291 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { | 291 TEST_F(PluginInstallerDownloadTest, PluginInstallerDownloadPathTest) { |
292 MessageLoop loop(MessageLoop::TYPE_IO); | 292 MessageLoop loop(MessageLoop::TYPE_IO); |
293 Start(); | 293 Start(); |
294 loop.Run(); | 294 loop.Run(); |
295 | 295 |
296 EXPECT_TRUE(success()); | 296 EXPECT_TRUE(success()); |
297 EXPECT_TRUE(initial_download_path().BaseName().value() == | 297 EXPECT_TRUE(initial_download_path().BaseName().value() == |
298 final_download_path().BaseName().value()); | 298 final_download_path().BaseName().value()); |
299 } | 299 } |
300 #endif // defined(OS_WIN) | 300 #endif // defined(OS_WIN) |
OLD | NEW |