summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-10 15:10:01 +0000
committeravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-10 15:10:01 +0000
commitec20c02ff689e82e5d70435a3d64f167112bf5e2 (patch)
tree0971c46f05b6a5ec802b45723adcc7ab8a4fc9d9 /webkit
parent3c8c8cb7e718a9289a85574b4b0453fd4a5f6bd7 (diff)
downloadchromium_src-ec20c02ff689e82e5d70435a3d64f167112bf5e2.zip
chromium_src-ec20c02ff689e82e5d70435a3d64f167112bf5e2.tar.gz
chromium_src-ec20c02ff689e82e5d70435a3d64f167112bf5e2.tar.bz2
Bring layout_test_controller.cc into the mac project.
Review URL: http://codereview.chromium.org/1856 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webpreferences.h4
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc12
-rw-r--r--webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj8
-rw-r--r--webkit/tools/test_shell/test_shell.cc9
-rw-r--r--webkit/tools/test_shell/test_shell.h2
5 files changed, 24 insertions, 11 deletions
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index d8dd90a..8a0a3f0 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -68,10 +68,10 @@ struct WebPreferences {
developer_extras_enabled(false), // Requires extra work by embedder
shrinks_standalone_images_to_fit(true),
uses_universal_detector(false), // Disabled: page cycler regression
- user_style_sheet_enabled(false),
text_areas_are_resizable(true),
dashboard_compatibility_mode(false),
- java_enabled(true) {
+ java_enabled(true),
+ user_style_sheet_enabled(false) {
}
};
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index f93a2b3..ad53a41 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -8,6 +8,7 @@
#include "webkit/tools/test_shell/layout_test_controller.h"
+#include "base/basictypes.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
@@ -20,6 +21,7 @@
using std::string;
using std::wstring;
+#if defined(OS_WIN)
namespace {
// Stops the test from running and prints a brief warning to stdout. Called
@@ -31,7 +33,7 @@ VOID CALLBACK TestTimeout(HWND hwnd, UINT msg, UINT_PTR timer_id, DWORD ms) {
}
}
-
+#endif
TestShell* LayoutTestController::shell_ = NULL;
bool LayoutTestController::dump_as_text_ = false;
@@ -210,6 +212,7 @@ void LayoutTestController::setAcceptsEditing(
void LayoutTestController::waitUntilDone(
const CppArgumentList& args, CppVariant* result) {
+#if defined(OS_WIN)
// Set a timer in case something hangs. We use a custom timer rather than
// the one managed by the message loop so we can kill it when the load
// finishes successfully.
@@ -218,6 +221,9 @@ void LayoutTestController::waitUntilDone(
SetTimer(shell_->mainWnd(), timer_id, shell_->GetFileTestTimeout(),
&TestTimeout);
}
+#else
+ // TODO(port): implement timer here
+#endif
wait_until_done_ = true;
result->SetNull();
}
@@ -349,14 +355,14 @@ void LayoutTestController::Reset() {
// shell. We don't want to delete elements as we're iterating, so we copy
// to a temp vector first.
WindowList* windows = TestShell::windowList();
- std::vector<HWND> windows_to_delete;
+ std::vector<gfx::WindowHandle> windows_to_delete;
for (WindowList::iterator i = windows->begin(); i != windows->end(); ++i) {
if (*i != shell_->mainWnd())
windows_to_delete.push_back(*i);
}
DCHECK(windows_to_delete.size() + 1 == windows->size());
for (size_t i = 0; i < windows_to_delete.size(); ++i) {
- DestroyWindow(windows_to_delete[i]);
+ TestShell::DestroyWindow(windows_to_delete[i]);
}
DCHECK(windows->size() == 1);
} else {
diff --git a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
index e4952a3..d477094 100644
--- a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
+++ b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj
@@ -46,7 +46,7 @@
E45629100E26B4FE005E4685 /* webwidget_host.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABD16F380DC6A73B0013D3AA /* webwidget_host.mm */; };
E45629150E26B4FE005E4685 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; };
E45629160E26B4FE005E4685 /* event_sending_controller.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB8A78520DC553A8005C27B8 /* event_sending_controller.cc */; };
- E45629170E26B4FE005E4685 /* layout_test_controller.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB8A77FD0DC54DD6005C27B8 /* layout_test_controller.mm */; };
+ E45629170E26B4FE005E4685 /* layout_test_controller.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB8A77FD0DC54DD6005C27B8 /* layout_test_controller.cc */; };
E45629180E26B4FE005E4685 /* navigation_controller_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB351E5B0DC7B3A5002F427A /* navigation_controller_base.cc */; };
E45629190E26B4FE005E4685 /* test_navigation_controller.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB351E2E0DC7B290002F427A /* test_navigation_controller.cc */; };
E456291A0E26B4FE005E4685 /* test_shell_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABA9CAE90DBC521D00CB1EFB /* test_shell_mac.mm */; };
@@ -345,7 +345,7 @@
AB351E5B0DC7B3A5002F427A /* navigation_controller_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = navigation_controller_base.cc; sourceTree = "<group>"; };
AB351E5C0DC7B3A5002F427A /* navigation_controller_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = navigation_controller_base.h; sourceTree = "<group>"; };
AB8665450DC78A5A002CE06A /* googleurl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = googleurl.xcodeproj; path = build/googleurl.xcodeproj; sourceTree = "<group>"; };
- AB8A77FD0DC54DD6005C27B8 /* layout_test_controller.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = layout_test_controller.mm; sourceTree = "<group>"; };
+ AB8A77FD0DC54DD6005C27B8 /* layout_test_controller.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = layout_test_controller.cc; sourceTree = "<group>"; };
AB8A77FE0DC54DD6005C27B8 /* layout_test_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = layout_test_controller.h; sourceTree = "<group>"; };
AB8A78510DC553A8005C27B8 /* event_sending_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = event_sending_controller.h; sourceTree = "<group>"; };
AB8A78520DC553A8005C27B8 /* event_sending_controller.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = event_sending_controller.cc; sourceTree = "<group>"; };
@@ -649,7 +649,7 @@
AB8A78520DC553A8005C27B8 /* event_sending_controller.cc */,
AB8A78510DC553A8005C27B8 /* event_sending_controller.h */,
AB8A77FE0DC54DD6005C27B8 /* layout_test_controller.h */,
- AB8A77FD0DC54DD6005C27B8 /* layout_test_controller.mm */,
+ AB8A77FD0DC54DD6005C27B8 /* layout_test_controller.cc */,
AB8A78540DC553BC005C27B8 /* node_leak_test.cc */,
E45629690E26B64D005E4685 /* simple_resource_loader_bridge.cc */,
E45629680E26B64D005E4685 /* simple_resource_loader_bridge.h */,
@@ -1041,7 +1041,7 @@
buildActionMask = 2147483647;
files = (
E45629160E26B4FE005E4685 /* event_sending_controller.cc in Sources */,
- E45629170E26B4FE005E4685 /* layout_test_controller.mm in Sources */,
+ E45629170E26B4FE005E4685 /* layout_test_controller.cc in Sources */,
E45629150E26B4FE005E4685 /* main.mm in Sources */,
E45629180E26B4FE005E4685 /* navigation_controller_base.cc in Sources */,
E456296A0E26B64D005E4685 /* simple_resource_loader_bridge.cc in Sources */,
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index ec8b023..04b9ddc 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -442,8 +442,7 @@ void TestShell::CallJSGC() {
/*static*/
bool TestShell::CreateNewWindow(const std::wstring& startingURL,
- TestShell** result)
-{
+ TestShell** result) {
TestShell* shell = new TestShell();
bool rv = shell->Initialize(startingURL);
if (rv) {
@@ -454,6 +453,12 @@ bool TestShell::CreateNewWindow(const std::wstring& startingURL,
return rv;
}
+/*static*/
+void TestShell::DestroyWindow(gfx::WindowHandle windowHandle) {
+ // Do we want to tear down some of the machinery behind the scenes too?
+ ::DestroyWindow(windowHandle);
+}
+
WebView* TestShell::CreateWebView(WebView* webview) {
// If we're running layout tests, only open a new window if the test has
// called layoutTestController.setCanOpenWindows()
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index 07fdc92..00c466d 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -156,6 +156,8 @@ public:
// If shell is non-null, then *shell is assigned upon successful return
static bool CreateNewWindow(const std::wstring& startingURL,
TestShell** shell = NULL);
+
+ static void DestroyWindow(gfx::WindowHandle windowHandle);
// Implements CreateWebView for TestWebViewDelegate, which in turn
// is called as a WebViewDelegate.