| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 } | 817 } |
| 818 }; | 818 }; |
| 819 | 819 |
| 820 class BrowserPluginThreadedCompositorPixelTest | 820 class BrowserPluginThreadedCompositorPixelTest |
| 821 : public BrowserPluginThreadedCompositorTest { | 821 : public BrowserPluginThreadedCompositorTest { |
| 822 protected: | 822 protected: |
| 823 virtual void SetUp() OVERRIDE { | 823 virtual void SetUp() OVERRIDE { |
| 824 EnablePixelOutput(); | 824 EnablePixelOutput(); |
| 825 BrowserPluginThreadedCompositorTest::SetUp(); | 825 BrowserPluginThreadedCompositorTest::SetUp(); |
| 826 } | 826 } |
| 827 | |
| 828 virtual void SetUpCommandLine(CommandLine* cmd) OVERRIDE { | |
| 829 BrowserPluginThreadedCompositorTest::SetUpCommandLine(cmd); | |
| 830 // http://crbug.com/327035 | |
| 831 cmd->AppendSwitch(switches::kDisableDelegatedRenderer); | |
| 832 } | |
| 833 }; | 827 }; |
| 834 | 828 |
| 835 static void CompareSkBitmaps(const SkBitmap& expected_bitmap, | 829 static void CompareSkBitmaps(const SkBitmap& expected_bitmap, |
| 836 const SkBitmap& bitmap) { | 830 const SkBitmap& bitmap) { |
| 837 EXPECT_EQ(expected_bitmap.width(), bitmap.width()); | 831 EXPECT_EQ(expected_bitmap.width(), bitmap.width()); |
| 838 if (expected_bitmap.width() != bitmap.width()) | 832 if (expected_bitmap.width() != bitmap.width()) |
| 839 return; | 833 return; |
| 840 EXPECT_EQ(expected_bitmap.height(), bitmap.height()); | 834 EXPECT_EQ(expected_bitmap.height(), bitmap.height()); |
| 841 if (expected_bitmap.height() != bitmap.height()) | 835 if (expected_bitmap.height() != bitmap.height()) |
| 842 return; | 836 return; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 const SkBitmap& expected_bitmap, | 883 const SkBitmap& expected_bitmap, |
| 890 bool *result, | 884 bool *result, |
| 891 bool succeed, | 885 bool succeed, |
| 892 const SkBitmap& bitmap) { | 886 const SkBitmap& bitmap) { |
| 893 *result = succeed; | 887 *result = succeed; |
| 894 if (succeed) | 888 if (succeed) |
| 895 CompareSkBitmaps(expected_bitmap, bitmap); | 889 CompareSkBitmaps(expected_bitmap, bitmap); |
| 896 callback.Run(); | 890 callback.Run(); |
| 897 } | 891 } |
| 898 | 892 |
| 899 // http://crbug.com/171744 | 893 // Mac: http://crbug.com/171744 |
| 900 #if defined(OS_MACOSX) | 894 // Aura/Ubercomp: http://crbug.com//327035 |
| 895 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 901 #define MAYBE_GetBackingStore DISABLED_GetBackingStore | 896 #define MAYBE_GetBackingStore DISABLED_GetBackingStore |
| 902 #else | 897 #else |
| 903 #define MAYBE_GetBackingStore GetBackingStore | 898 #define MAYBE_GetBackingStore GetBackingStore |
| 904 #endif | 899 #endif |
| 905 IN_PROC_BROWSER_TEST_F(BrowserPluginThreadedCompositorPixelTest, | 900 IN_PROC_BROWSER_TEST_F(BrowserPluginThreadedCompositorPixelTest, |
| 906 MAYBE_GetBackingStore) { | 901 MAYBE_GetBackingStore) { |
| 907 const char kEmbedderURL[] = "/browser_plugin_embedder.html"; | 902 const char kEmbedderURL[] = "/browser_plugin_embedder.html"; |
| 908 const char kHTMLForGuest[] = | 903 const char kHTMLForGuest[] = |
| 909 "data:text/html,<html><style>body { background-color: red; }</style>" | 904 "data:text/html,<html><style>body { background-color: red; }</style>" |
| 910 "<body></body></html>"; | 905 "<body></body></html>"; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 scoped_ptr<base::Value> value = | 1080 scoped_ptr<base::Value> value = |
| 1086 content::ExecuteScriptAndGetValue( | 1081 content::ExecuteScriptAndGetValue( |
| 1087 guest_rvh, "document.getElementById('input1').value"); | 1082 guest_rvh, "document.getElementById('input1').value"); |
| 1088 std::string actual_value; | 1083 std::string actual_value; |
| 1089 ASSERT_TRUE(value->GetAsString(&actual_value)); | 1084 ASSERT_TRUE(value->GetAsString(&actual_value)); |
| 1090 EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); | 1085 EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); |
| 1091 } | 1086 } |
| 1092 } | 1087 } |
| 1093 | 1088 |
| 1094 } // namespace content | 1089 } // namespace content |
| OLD | NEW |