Chromium Code Reviews| Index: chrome/renderer/chrome_content_renderer_client_unittest.cc |
| diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc |
| index 6e6876c290c1f60956b597ab5f85908bf1934038..55bbd7b6b87ad08ef29f50423614be305c8a0b66 100644 |
| --- a/chrome/renderer/chrome_content_renderer_client_unittest.cc |
| +++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc |
| @@ -9,15 +9,18 @@ |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/renderer/searchbox/search_bouncer.h" |
| #include "content/public/common/webplugininfo.h" |
| -#include "extensions/common/extension.h" |
| -#include "extensions/common/extension_builder.h" |
| -#include "extensions/common/manifest_constants.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
|
Yoyo Zhou
2014/10/23 00:03:59
Looks like you only need the webkit headers if !de
Lei Zhang
2014/10/23 00:30:46
Done.
|
| #include "third_party/WebKit/public/platform/WebVector.h" |
| #include "third_party/WebKit/public/web/WebPluginParams.h" |
| #include "url/gurl.h" |
| +#if defined(ENABLE_EXTENSIONS) |
| +#include "extensions/common/extension.h" |
| +#include "extensions/common/extension_builder.h" |
| +#include "extensions/common/manifest_constants.h" |
| +#endif |
| + |
| using blink::WebPluginParams; |
| using blink::WebString; |
| using blink::WebVector; |
| @@ -50,6 +53,7 @@ const char kChatManifestFS2[] = "filesystem:https://foo.plus.google.com/foo"; |
| const char kChatManifestFS3[] = |
| "filesystem:https://foo.plus.sandbox.google.com/foo"; |
| +#if !defined(DISABLE_NACL) |
| bool AllowsDevInterfaces(const WebPluginParams& params) { |
| for (size_t i = 0; i < params.attributeNames.size(); ++i) { |
| if (params.attributeNames[i] == WebString::fromUTF8("@dev")) |
| @@ -66,6 +70,7 @@ void AddFakeDevAttribute(WebPluginParams* params) { |
| params->attributeNames.swap(names); |
| params->attributeValues.swap(values); |
| } |
| +#endif |
| void AddContentTypeHandler(content::WebPluginInfo* info, |
| const char* mime_type, |
| @@ -82,6 +87,7 @@ void AddContentTypeHandler(content::WebPluginInfo* info, |
| typedef testing::Test ChromeContentRendererClientTest; |
| +#if defined(ENABLE_EXTENSIONS) |
| scoped_refptr<const extensions::Extension> CreateTestExtension( |
| bool is_unrestricted, bool is_from_webstore, bool is_hosted_app, |
| const std::string& app_url) { |
| @@ -118,6 +124,7 @@ scoped_refptr<const extensions::Extension> CreateHostedApp( |
| return CreateTestExtension(is_unrestricted, is_from_webstore, kHostedApp, |
| app_url); |
| } |
| +#endif // defined(ENABLE_EXTENSIONS) |
| TEST_F(ChromeContentRendererClientTest, NaClRestriction) { |
| // Unknown content types have no NaCl module. |
| @@ -135,6 +142,7 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { |
| ChromeContentRendererClient::GetNaClContentHandlerURL( |
| "application/x-foo", info)); |
| } |
| +#if !defined(DISABLE_NACL) |
| // --enable-nacl allows all NaCl apps, with 'dev' interfaces. |
| { |
| WebPluginParams params; |
| @@ -372,6 +380,7 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) { |
| "http://example.com/").get(), |
| ¶ms)); |
| } |
| +#endif // !defined(DISABLE_NACL) |
| } |
| TEST_F(ChromeContentRendererClientTest, AllowPepperMediaStreamAPI) { |