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

Unified Diff: webkit/tools/test_shell/layout_test_controller.cc

Issue 192004: Change the default cookie policy to be closer to the default in WebKit's Dump... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/layout_test_controller.cc
===================================================================
--- webkit/tools/test_shell/layout_test_controller.cc (revision 25298)
+++ webkit/tools/test_shell/layout_test_controller.cc (working copy)
@@ -21,6 +21,7 @@
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/webview.h"
+#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
#include "webkit/tools/test_shell/test_navigation_controller.h"
#include "webkit/tools/test_shell/test_shell.h"
@@ -99,6 +100,7 @@
BindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
BindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
BindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual);
+ BindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
BindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
BindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements);
BindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
@@ -428,6 +430,7 @@
globalFlag_.Set(false);
webHistoryItemCount_.Set(0);
+ SimpleResourceLoaderBridge::SetAcceptAllCookies(false);
WebKit::resetOriginAccessWhiteLists();
if (close_remaining_windows_) {
@@ -499,6 +502,14 @@
result->SetNull();
}
+void LayoutTestController::setAlwaysAcceptCookies(
+ const CppArgumentList& args, CppVariant* result) {
+ if (args.size() > 0) {
+ SimpleResourceLoaderBridge::SetAcceptAllCookies(CppVariantToBool(args[0]));
+ }
+ result->SetNull();
+}
+
void LayoutTestController::setWindowIsKey(
const CppArgumentList& args, CppVariant* result) {
if (args.size() > 0 && args[0].isBool()) {
@@ -812,7 +823,7 @@
result->SetNull();
}
-// Need these conversions because the format of the value for overridePreference
+// Need these conversions because the format of the value for booleans
// may vary - for example, on mac "1" and "0" are used for boolean.
bool LayoutTestController::CppVariantToBool(const CppVariant& value) {
if (value.isBool())
@@ -827,7 +838,7 @@
return false;
}
shell_->delegate()->AddMessageToConsole(shell_->webView(),
- L"Invalid value for preference. Expected boolean value.", 0, L"");
+ L"Invalid value. Expected boolean value.", 0, L"");
return false;
}
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.h ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698