summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 09:14:10 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 09:14:10 +0000
commita776192555534fc7ac5208ebf71e4956c6094aee (patch)
treee74aff438cf1f40a6091a2e145e4197bc043884c /webkit/tools
parentf8ea339a938c7fada337261fafd48c823d4e91a4 (diff)
downloadchromium_src-a776192555534fc7ac5208ebf71e4956c6094aee.zip
chromium_src-a776192555534fc7ac5208ebf71e4956c6094aee.tar.gz
chromium_src-a776192555534fc7ac5208ebf71e4956c6094aee.tar.bz2
Adding support for markerTextForListItem() to Chromium's LayoutTestController.
TEST=none BUG=53289 Review URL: http://codereview.chromium.org/3213001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc30
-rw-r--r--webkit/tools/test_shell/layout_test_controller.h3
2 files changed, 28 insertions, 5 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index d6cc4b8..85b84fd 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -15,7 +15,10 @@
#include "base/path_service.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationServiceMock.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
@@ -38,10 +41,15 @@
using std::string;
using std::wstring;
+using WebKit::WebBindings;
using WebKit::WebConsoleMessage;
+using WebKit::WebGeolocationServiceMock;
+using WebKit::WebElement;
using WebKit::WebScriptSource;
using WebKit::WebSecurityPolicy;
+using WebKit::WebSize;
using WebKit::WebString;
+using WebKit::WebURL;
TestShell* LayoutTestController::shell_ = NULL;
// Most of these flags need to be cleared in Reset() so that they get turned
@@ -178,6 +186,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) :
BindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
BindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
+ BindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
+
// The fallback method is called when an unknown method is invoked.
BindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -890,7 +900,7 @@ void LayoutTestController::dumpSelectionRect(
void LayoutTestController::display(
const CppArgumentList& args, CppVariant* result) {
WebViewHost* view_host = shell_->webViewHost();
- const WebKit::WebSize& size = view_host->webview()->size();
+ const WebSize& size = view_host->webview()->size();
gfx::Rect rect(size.width, size.height);
view_host->UpdatePaintRect(rect);
view_host->Paint();
@@ -1129,7 +1139,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(
!args[2].isString() || !args[3].isBool())
return;
- WebKit::WebURL url(GURL(args[0].ToString()));
+ WebURL url(GURL(args[0].ToString()));
if (!url.isValid())
return;
@@ -1148,7 +1158,7 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(
!args[2].isString() || !args[3].isBool())
return;
- WebKit::WebURL url(GURL(args[0].ToString()));
+ WebURL url(GURL(args[0].ToString()));
if (!url.isValid())
return;
@@ -1319,7 +1329,7 @@ void LayoutTestController::setMockGeolocationPosition(
if (args.size() < 3 ||
!args[0].isNumber() || !args[1].isNumber() || !args[2].isNumber())
return;
- WebKit::WebGeolocationServiceMock::setMockGeolocationPosition(
+ WebGeolocationServiceMock::setMockGeolocationPosition(
args[0].ToDouble(), args[1].ToDouble(), args[2].ToDouble());
}
@@ -1328,6 +1338,16 @@ void LayoutTestController::setMockGeolocationError(const CppArgumentList& args,
if (args.size() < 2 ||
!args[0].isInt32() || !args[1].isString())
return;
- WebKit::WebGeolocationServiceMock::setMockGeolocationError(
+ WebGeolocationServiceMock::setMockGeolocationError(
args[0].ToInt32(), WebString::fromUTF8(args[1].ToString()));
}
+
+void LayoutTestController::markerTextForListItem(const CppArgumentList& args,
+ CppVariant* result) {
+ WebElement element;
+ if (!WebBindings::getElement(args[0].value.objectValue, &element))
+ result->SetNull();
+ else
+ result->Set(
+ element.document().frame()->markerTextForListItem(element).utf8());
+}
diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h
index 8394d8b..28ae5ea 100644
--- a/webkit/tools/test_shell/layout_test_controller.h
+++ b/webkit/tools/test_shell/layout_test_controller.h
@@ -283,6 +283,9 @@ class LayoutTestController : public CppBoundClass {
void setMockGeolocationError(const CppArgumentList& args,
CppVariant* result);
+ void markerTextForListItem(const CppArgumentList& args,
+ CppVariant* result);
+
public:
// The following methods are not exposed to JavaScript.
void SetWorkQueueFrozen(bool frozen) { work_queue_.set_frozen(frozen); }