Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: webkit/tools/test_shell/layout_test_controller.cc

Issue 556061: Enable WebGL layout tests. (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This file contains the definition for LayoutTestController. 5 // This file contains the definition for LayoutTestController.
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "webkit/tools/test_shell/layout_test_controller.h" 9 #include "webkit/tools/test_shell/layout_test_controller.h"
10 10
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 896
897 // Need these conversions because the format of the value for booleans 897 // Need these conversions because the format of the value for booleans
898 // may vary - for example, on mac "1" and "0" are used for boolean. 898 // may vary - for example, on mac "1" and "0" are used for boolean.
899 bool LayoutTestController::CppVariantToBool(const CppVariant& value) { 899 bool LayoutTestController::CppVariantToBool(const CppVariant& value) {
900 if (value.isBool()) 900 if (value.isBool())
901 return value.ToBoolean(); 901 return value.ToBoolean();
902 else if (value.isInt32()) 902 else if (value.isInt32())
903 return 0 != value.ToInt32(); 903 return 0 != value.ToInt32();
904 else if (value.isString()) { 904 else if (value.isString()) {
905 std::string valueString = value.ToString(); 905 std::string valueString = value.ToString();
906 if (valueString == "true") 906 if (valueString == "true" || valueString == "1")
907 return true; 907 return true;
908 if (valueString == "false") 908 if (valueString == "false" || valueString == "0")
909 return false; 909 return false;
910 } 910 }
911 LogErrorToConsole("Invalid value. Expected boolean value."); 911 LogErrorToConsole("Invalid value. Expected boolean value.");
912 return false; 912 return false;
913 } 913 }
914 914
915 int32 LayoutTestController::CppVariantToInt32(const CppVariant& value) { 915 int32 LayoutTestController::CppVariantToInt32(const CppVariant& value) {
916 if (value.isInt32()) 916 if (value.isInt32())
917 return value.ToInt32(); 917 return value.ToInt32();
918 else if (value.isString()) { 918 else if (value.isString()) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 else if (key == "WebKitUsesPageCachePreferenceKey") 984 else if (key == "WebKitUsesPageCachePreferenceKey")
985 preferences->uses_page_cache = CppVariantToBool(value); 985 preferences->uses_page_cache = CppVariantToBool(value);
986 else if (key == "WebKitXSSAuditorEnabled") 986 else if (key == "WebKitXSSAuditorEnabled")
987 preferences->xss_auditor_enabled = CppVariantToBool(value); 987 preferences->xss_auditor_enabled = CppVariantToBool(value);
988 else if (key == "WebKitLocalStorageEnabledPreferenceKey") 988 else if (key == "WebKitLocalStorageEnabledPreferenceKey")
989 preferences->local_storage_enabled = CppVariantToBool(value); 989 preferences->local_storage_enabled = CppVariantToBool(value);
990 else if (key == "WebKitOfflineWebApplicationCacheEnabled") 990 else if (key == "WebKitOfflineWebApplicationCacheEnabled")
991 preferences->application_cache_enabled = CppVariantToBool(value); 991 preferences->application_cache_enabled = CppVariantToBool(value);
992 else if (key == "WebKitTabToLinksPreferenceKey") 992 else if (key == "WebKitTabToLinksPreferenceKey")
993 preferences->tabs_to_links = CppVariantToBool(value); 993 preferences->tabs_to_links = CppVariantToBool(value);
994 else if (key == "WebKitWebGLEnabled")
995 preferences->experimental_webgl_enabled = CppVariantToBool(value);
994 else { 996 else {
995 std::string message("Invalid name for preference: "); 997 std::string message("Invalid name for preference: ");
996 message.append(key); 998 message.append(key);
997 LogErrorToConsole(message); 999 LogErrorToConsole(message);
998 } 1000 }
999 preferences->Apply(shell_->webView()); 1001 preferences->Apply(shell_->webView());
1000 } 1002 }
1001 result->SetNull(); 1003 result->SetNull();
1002 } 1004 }
1003 1005
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 shell_->dev_tools_agent()->evaluateInWebInspector(args[0].ToInt32(), 1090 shell_->dev_tools_agent()->evaluateInWebInspector(args[0].ToInt32(),
1089 args[1].ToString()); 1091 args[1].ToString());
1090 } 1092 }
1091 1093
1092 void LayoutTestController::forceRedSelectionColors(const CppArgumentList& args, 1094 void LayoutTestController::forceRedSelectionColors(const CppArgumentList& args,
1093 CppVariant* result) { 1095 CppVariant* result) {
1094 result->SetNull(); 1096 result->SetNull();
1095 shell_->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 1097 shell_->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000,
1096 0xffc0c0c0); 1098 0xffc0c0c0);
1097 } 1099 }
OLDNEW
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698