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_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 }; | 125 }; |
126 | 126 |
127 class PluginServiceTest : public ContentBrowserTest { | 127 class PluginServiceTest : public ContentBrowserTest { |
128 public: | 128 public: |
129 PluginServiceTest() {} | 129 PluginServiceTest() {} |
130 | 130 |
131 ResourceContext* GetResourceContext() { | 131 ResourceContext* GetResourceContext() { |
132 return shell()->web_contents()->GetBrowserContext()->GetResourceContext(); | 132 return shell()->web_contents()->GetBrowserContext()->GetResourceContext(); |
133 } | 133 } |
134 | 134 |
135 void SetUpCommandLine(CommandLine* command_line) override { | 135 void SetUpCommandLine(base::CommandLine* command_line) override { |
136 #if defined(OS_MACOSX) | 136 #if defined(OS_MACOSX) |
137 base::FilePath browser_directory; | 137 base::FilePath browser_directory; |
138 PathService::Get(base::DIR_MODULE, &browser_directory); | 138 PathService::Get(base::DIR_MODULE, &browser_directory); |
139 command_line->AppendSwitchPath(switches::kExtraPluginDir, | 139 command_line->AppendSwitchPath(switches::kExtraPluginDir, |
140 browser_directory.AppendASCII("plugins")); | 140 browser_directory.AppendASCII("plugins")); |
141 #endif | 141 #endif |
142 // TODO(jam): since these plugin tests are running under Chrome, we need to | 142 // TODO(jam): since these plugin tests are running under Chrome, we need to |
143 // tell it to disable its security features for old plugins. Once this is | 143 // tell it to disable its security features for old plugins. Once this is |
144 // running under content_browsertests, these flags won't be needed. | 144 // running under content_browsertests, these flags won't be needed. |
145 // http://crbug.com/90448 | 145 // http://crbug.com/90448 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 BrowserThread::IO, FROM_HERE, | 360 BrowserThread::IO, FROM_HERE, |
361 base::Bind(&OpenChannel, &mock_client)); | 361 base::Bind(&OpenChannel, &mock_client)); |
362 RunMessageLoop(); | 362 RunMessageLoop(); |
363 EXPECT_TRUE(mock_client.get_resource_context_called()); | 363 EXPECT_TRUE(mock_client.get_resource_context_called()); |
364 EXPECT_TRUE(mock_client.set_plugin_info_called()); | 364 EXPECT_TRUE(mock_client.set_plugin_info_called()); |
365 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); | 365 EXPECT_TRUE(mock_client.on_found_plugin_process_host_called()); |
366 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); | 366 EXPECT_TRUE(mock_client.on_sent_plugin_channel_request_called()); |
367 } | 367 } |
368 | 368 |
369 } // namespace content | 369 } // namespace content |
OLD | NEW |