| 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 #include "content/browser/plugin_loader_posix.h" | 5 #include "content/browser/plugin_loader_posix.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 std::vector<webkit::WebPluginInfo>* internal_plugins() { | 40 std::vector<webkit::WebPluginInfo>* internal_plugins() { |
| 41 return &internal_plugins_; | 41 return &internal_plugins_; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void RealLoadPluginsInternal() { | 44 void RealLoadPluginsInternal() { |
| 45 PluginLoaderPosix::LoadPluginsInternal(); | 45 PluginLoaderPosix::LoadPluginsInternal(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void TestOnPluginLoaded(uint32_t index, const webkit::WebPluginInfo& plugin) { | 48 void TestOnPluginLoaded(uint32 index, const webkit::WebPluginInfo& plugin) { |
| 49 OnPluginLoaded(index, plugin); | 49 OnPluginLoaded(index, plugin); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void TestOnPluginLoadFailed(uint32_t index, const FilePath& path) { | 52 void TestOnPluginLoadFailed(uint32 index, const FilePath& path) { |
| 53 OnPluginLoadFailed(index, path); | 53 OnPluginLoadFailed(index, path); |
| 54 } | 54 } |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 void VerifyCallback(int* run_count, const std::vector<webkit::WebPluginInfo>&) { | 57 void VerifyCallback(int* run_count, const std::vector<webkit::WebPluginInfo>&) { |
| 58 ++(*run_count); | 58 ++(*run_count); |
| 59 } | 59 } |
| 60 | 60 |
| 61 class PluginLoaderPosixTest : public testing::Test { | 61 class PluginLoaderPosixTest : public testing::Test { |
| 62 public: | 62 public: |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 &MockPluginLoaderPosix::RealLoadPluginsInternal)); | 309 &MockPluginLoaderPosix::RealLoadPluginsInternal)); |
| 310 plugin_loader()->OnProcessCrashed(42); | 310 plugin_loader()->OnProcessCrashed(42); |
| 311 plugin_loader()->OnProcessCrashed(42); | 311 plugin_loader()->OnProcessCrashed(42); |
| 312 plugin_loader()->OnProcessCrashed(42); | 312 plugin_loader()->OnProcessCrashed(42); |
| 313 | 313 |
| 314 message_loop()->RunAllPending(); | 314 message_loop()->RunAllPending(); |
| 315 EXPECT_EQ(1, did_callback); | 315 EXPECT_EQ(1, did_callback); |
| 316 | 316 |
| 317 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); | 317 EXPECT_EQ(0u, plugin_loader()->loaded_plugins().size()); |
| 318 } | 318 } |
| OLD | NEW |