| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 10 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 content::WebContents* web_contents = | 316 content::WebContents* web_contents = |
| 317 browser()->tab_strip_model()->GetActiveWebContents(); | 317 browser()->tab_strip_model()->GetActiveWebContents(); |
| 318 | 318 |
| 319 EXPECT_TRUE(TabSpecificContentSettings::FromWebContents(web_contents)-> | 319 EXPECT_TRUE(TabSpecificContentSettings::FromWebContents(web_contents)-> |
| 320 IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); | 320 IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); |
| 321 } | 321 } |
| 322 | 322 |
| 323 #if defined(ENABLE_PLUGINS) | 323 #if defined(ENABLE_PLUGINS) |
| 324 class PepperContentSettingsSpecialCasesTest : public ContentSettingsTest { | 324 class PepperContentSettingsSpecialCasesTest : public ContentSettingsTest { |
| 325 protected: | 325 protected: |
| 326 static const char* const kExternalClearKeyMimeType; | 326 static const char kExternalClearKeyMimeType[]; |
| 327 | 327 |
| 328 // Registers any CDM plugins not registered by default. | 328 // Registers any CDM plugins not registered by default. |
| 329 void SetUpCommandLine(base::CommandLine* command_line) override { | 329 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 330 #if defined(ENABLE_PEPPER_CDMS) | 330 #if defined(ENABLE_PEPPER_CDMS) |
| 331 // Platform-specific filename relative to the chrome executable. | 331 // Platform-specific filename relative to the chrome executable. |
| 332 #if defined(OS_WIN) | 332 #if defined(OS_WIN) |
| 333 const char kLibraryName[] = "clearkeycdmadapter.dll"; | 333 const char kLibraryName[] = "clearkeycdmadapter.dll"; |
| 334 #else // !defined(OS_WIN) | 334 #else // !defined(OS_WIN) |
| 335 #if defined(OS_MACOSX) | 335 #if defined(OS_MACOSX) |
| 336 const char kLibraryName[] = "clearkeycdmadapter.plugin"; | 336 const char kLibraryName[] = "clearkeycdmadapter.plugin"; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 #if defined(OS_WIN) | 458 #if defined(OS_WIN) |
| 459 pepper_plugin.append(base::ASCIIToUTF16(string_to_append)); | 459 pepper_plugin.append(base::ASCIIToUTF16(string_to_append)); |
| 460 #else | 460 #else |
| 461 pepper_plugin.append(string_to_append); | 461 pepper_plugin.append(string_to_append); |
| 462 #endif | 462 #endif |
| 463 | 463 |
| 464 return pepper_plugin; | 464 return pepper_plugin; |
| 465 } | 465 } |
| 466 }; | 466 }; |
| 467 | 467 |
| 468 const char* const | 468 const char |
| 469 PepperContentSettingsSpecialCasesTest::kExternalClearKeyMimeType = | 469 PepperContentSettingsSpecialCasesTest::kExternalClearKeyMimeType[] = |
| 470 "application/x-ppapi-clearkey-cdm"; | 470 "application/x-ppapi-clearkey-cdm"; |
| 471 | 471 |
| 472 class PepperContentSettingsSpecialCasesPluginsBlockedTest | 472 class PepperContentSettingsSpecialCasesPluginsBlockedTest |
| 473 : public PepperContentSettingsSpecialCasesTest { | 473 : public PepperContentSettingsSpecialCasesTest { |
| 474 public: | 474 public: |
| 475 void SetUpOnMainThread() override { | 475 void SetUpOnMainThread() override { |
| 476 PepperContentSettingsSpecialCasesTest::SetUpOnMainThread(); | 476 PepperContentSettingsSpecialCasesTest::SetUpOnMainThread(); |
| 477 HostContentSettingsMapFactory::GetForProfile(browser()->profile()) | 477 HostContentSettingsMapFactory::GetForProfile(browser()->profile()) |
| 478 ->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, | 478 ->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
| 479 CONTENT_SETTING_BLOCK); | 479 CONTENT_SETTING_BLOCK); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 592 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 593 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 593 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 594 switches::kAshBrowserTests)) | 594 switches::kAshBrowserTests)) |
| 595 return; | 595 return; |
| 596 #endif | 596 #endif |
| 597 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); | 597 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); |
| 598 } | 598 } |
| 599 #endif // !defined(DISABLE_NACL) | 599 #endif // !defined(DISABLE_NACL) |
| 600 | 600 |
| 601 #endif // defined(ENABLE_PLUGINS) | 601 #endif // defined(ENABLE_PLUGINS) |
| OLD | NEW |