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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ASCIIToUTF16("1.0"), base::string16()), | 70 ASCIIToUTF16("1.0"), base::string16()), |
71 plugin2_(ASCIIToUTF16("plugin2"), base::FilePath("/tmp/two.plugin"), | 71 plugin2_(ASCIIToUTF16("plugin2"), base::FilePath("/tmp/two.plugin"), |
72 ASCIIToUTF16("2.0"), base::string16()), | 72 ASCIIToUTF16("2.0"), base::string16()), |
73 plugin3_(ASCIIToUTF16("plugin3"), base::FilePath("/tmp/three.plugin"), | 73 plugin3_(ASCIIToUTF16("plugin3"), base::FilePath("/tmp/three.plugin"), |
74 ASCIIToUTF16("3.0"), base::string16()), | 74 ASCIIToUTF16("3.0"), base::string16()), |
75 file_thread_(BrowserThread::FILE, &message_loop_), | 75 file_thread_(BrowserThread::FILE, &message_loop_), |
76 io_thread_(BrowserThread::IO, &message_loop_), | 76 io_thread_(BrowserThread::IO, &message_loop_), |
77 plugin_loader_(new MockPluginLoaderPosix) { | 77 plugin_loader_(new MockPluginLoaderPosix) { |
78 } | 78 } |
79 | 79 |
80 virtual void SetUp() OVERRIDE { | 80 virtual void SetUp() override { |
81 PluginServiceImpl::GetInstance()->Init(); | 81 PluginServiceImpl::GetInstance()->Init(); |
82 } | 82 } |
83 | 83 |
84 base::MessageLoop* message_loop() { return &message_loop_; } | 84 base::MessageLoop* message_loop() { return &message_loop_; } |
85 MockPluginLoaderPosix* plugin_loader() { return plugin_loader_.get(); } | 85 MockPluginLoaderPosix* plugin_loader() { return plugin_loader_.get(); } |
86 | 86 |
87 void AddThreePlugins() { | 87 void AddThreePlugins() { |
88 plugin_loader_->canonical_list()->clear(); | 88 plugin_loader_->canonical_list()->clear(); |
89 plugin_loader_->canonical_list()->push_back(plugin1_.path); | 89 plugin_loader_->canonical_list()->push_back(plugin1_.path); |
90 plugin_loader_->canonical_list()->push_back(plugin2_.path); | 90 plugin_loader_->canonical_list()->push_back(plugin2_.path); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 plugin_loader()->OnProcessCrashed(42); | 390 plugin_loader()->OnProcessCrashed(42); |
391 plugin_loader()->OnProcessCrashed(42); | 391 plugin_loader()->OnProcessCrashed(42); |
392 | 392 |
393 message_loop()->RunUntilIdle(); | 393 message_loop()->RunUntilIdle(); |
394 EXPECT_EQ(1, did_callback); | 394 EXPECT_EQ(1, did_callback); |
395 | 395 |
396 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); | 396 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); |
397 } | 397 } |
398 | 398 |
399 } // namespace content | 399 } // namespace content |
OLD | NEW |