| 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 "content/browser/plugin_loader_posix.h" | 5 #include "content/browser/plugin_loader_posix.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 void VerifyCallback(int* run_count, const std::vector<WebPluginInfo>&) { | 59 void VerifyCallback(int* run_count, const std::vector<WebPluginInfo>&) { |
| 60 ++(*run_count); | 60 ++(*run_count); |
| 61 } | 61 } |
| 62 | 62 |
| 63 class PluginLoaderPosixTest : public testing::Test { | 63 class PluginLoaderPosixTest : public testing::Test { |
| 64 public: | 64 public: |
| 65 PluginLoaderPosixTest() | 65 PluginLoaderPosixTest() |
| 66 : plugin1_(ASCIIToUTF16("plugin1"), base::FilePath("/tmp/one.plugin"), | 66 : plugin1_(ASCIIToUTF16("plugin1"), base::FilePath("/tmp/one.plugin"), |
| 67 ASCIIToUTF16("1.0"), string16()), | 67 ASCIIToUTF16("1.0"), base::string16()), |
| 68 plugin2_(ASCIIToUTF16("plugin2"), base::FilePath("/tmp/two.plugin"), | 68 plugin2_(ASCIIToUTF16("plugin2"), base::FilePath("/tmp/two.plugin"), |
| 69 ASCIIToUTF16("2.0"), string16()), | 69 ASCIIToUTF16("2.0"), base::string16()), |
| 70 plugin3_(ASCIIToUTF16("plugin3"), base::FilePath("/tmp/three.plugin"), | 70 plugin3_(ASCIIToUTF16("plugin3"), base::FilePath("/tmp/three.plugin"), |
| 71 ASCIIToUTF16("3.0"), string16()), | 71 ASCIIToUTF16("3.0"), base::string16()), |
| 72 file_thread_(BrowserThread::FILE, &message_loop_), | 72 file_thread_(BrowserThread::FILE, &message_loop_), |
| 73 io_thread_(BrowserThread::IO, &message_loop_), | 73 io_thread_(BrowserThread::IO, &message_loop_), |
| 74 plugin_loader_(new MockPluginLoaderPosix) { | 74 plugin_loader_(new MockPluginLoaderPosix) { |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual void SetUp() OVERRIDE { | 77 virtual void SetUp() OVERRIDE { |
| 78 PluginServiceImpl::GetInstance()->Init(); | 78 PluginServiceImpl::GetInstance()->Init(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 base::MessageLoop* message_loop() { return &message_loop_; } | 81 base::MessageLoop* message_loop() { return &message_loop_; } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 plugin_loader()->OnProcessCrashed(42); | 364 plugin_loader()->OnProcessCrashed(42); |
| 365 plugin_loader()->OnProcessCrashed(42); | 365 plugin_loader()->OnProcessCrashed(42); |
| 366 | 366 |
| 367 message_loop()->RunUntilIdle(); | 367 message_loop()->RunUntilIdle(); |
| 368 EXPECT_EQ(1, did_callback); | 368 EXPECT_EQ(1, did_callback); |
| 369 | 369 |
| 370 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); | 370 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace content | 373 } // namespace content |
| OLD | NEW |