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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 PluginLoaderPosix::LoadPluginsInternal(); | 46 PluginLoaderPosix::LoadPluginsInternal(); |
47 } | 47 } |
48 | 48 |
49 void TestOnPluginLoaded(uint32 index, const webkit::WebPluginInfo& plugin) { | 49 void TestOnPluginLoaded(uint32 index, const webkit::WebPluginInfo& plugin) { |
50 OnPluginLoaded(index, plugin); | 50 OnPluginLoaded(index, plugin); |
51 } | 51 } |
52 | 52 |
53 void TestOnPluginLoadFailed(uint32 index, const FilePath& path) { | 53 void TestOnPluginLoadFailed(uint32 index, const FilePath& path) { |
54 OnPluginLoadFailed(index, path); | 54 OnPluginLoadFailed(index, path); |
55 } | 55 } |
| 56 |
| 57 protected: |
| 58 virtual ~MockPluginLoaderPosix() {} |
56 }; | 59 }; |
57 | 60 |
58 void VerifyCallback(int* run_count, const std::vector<webkit::WebPluginInfo>&) { | 61 void VerifyCallback(int* run_count, const std::vector<webkit::WebPluginInfo>&) { |
59 ++(*run_count); | 62 ++(*run_count); |
60 } | 63 } |
61 | 64 |
62 class PluginLoaderPosixTest : public testing::Test { | 65 class PluginLoaderPosixTest : public testing::Test { |
63 public: | 66 public: |
64 PluginLoaderPosixTest() | 67 PluginLoaderPosixTest() |
65 : plugin1_(ASCIIToUTF16("plugin1"), FilePath("/tmp/one.plugin"), | 68 : plugin1_(ASCIIToUTF16("plugin1"), FilePath("/tmp/one.plugin"), |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 &MockPluginLoaderPosix::RealLoadPluginsInternal)); | 369 &MockPluginLoaderPosix::RealLoadPluginsInternal)); |
367 plugin_loader()->OnProcessCrashed(42); | 370 plugin_loader()->OnProcessCrashed(42); |
368 plugin_loader()->OnProcessCrashed(42); | 371 plugin_loader()->OnProcessCrashed(42); |
369 plugin_loader()->OnProcessCrashed(42); | 372 plugin_loader()->OnProcessCrashed(42); |
370 | 373 |
371 message_loop()->RunAllPending(); | 374 message_loop()->RunAllPending(); |
372 EXPECT_EQ(1, did_callback); | 375 EXPECT_EQ(1, did_callback); |
373 | 376 |
374 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); | 377 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); |
375 } | 378 } |
OLD | NEW |