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" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "content/test/test_browser_thread.h" | 12 #include "content/test/test_browser_thread.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "webkit/plugins/webplugininfo.h" | 15 #include "webkit/plugins/webplugininfo.h" |
16 | 16 |
| 17 using content::BrowserThread; |
| 18 |
17 class MockPluginLoaderPosix : public PluginLoaderPosix { | 19 class MockPluginLoaderPosix : public PluginLoaderPosix { |
18 public: | 20 public: |
19 MOCK_METHOD0(LoadPluginsInternal, void(void)); | 21 MOCK_METHOD0(LoadPluginsInternal, void(void)); |
20 | 22 |
21 size_t number_of_pending_callbacks() { | 23 size_t number_of_pending_callbacks() { |
22 return callbacks_.size(); | 24 return callbacks_.size(); |
23 } | 25 } |
24 | 26 |
25 std::vector<FilePath>* canonical_list() { | 27 std::vector<FilePath>* canonical_list() { |
26 return &canonical_list_; | 28 return &canonical_list_; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 message_loop()->RunAllPending(); | 271 message_loop()->RunAllPending(); |
270 EXPECT_EQ(0, did_callback); | 272 EXPECT_EQ(0, did_callback); |
271 | 273 |
272 plugin_loader()->TestOnPluginLoaded(plugin3_); | 274 plugin_loader()->TestOnPluginLoaded(plugin3_); |
273 EXPECT_EQ(3u, plugins.size()); | 275 EXPECT_EQ(3u, plugins.size()); |
274 EXPECT_EQ(plugin3_.name, plugins[2].name); | 276 EXPECT_EQ(plugin3_.name, plugins[2].name); |
275 | 277 |
276 message_loop()->RunAllPending(); | 278 message_loop()->RunAllPending(); |
277 EXPECT_EQ(1, did_callback); | 279 EXPECT_EQ(1, did_callback); |
278 } | 280 } |
OLD | NEW |