OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 std::string new_locale = args[0].ToString(); | 1327 std::string new_locale = args[0].ToString(); |
1328 setlocale(LC_ALL, new_locale.c_str()); | 1328 setlocale(LC_ALL, new_locale.c_str()); |
1329 } | 1329 } |
1330 } | 1330 } |
1331 | 1331 |
1332 void LayoutTestController::counterValueForElementById( | 1332 void LayoutTestController::counterValueForElementById( |
1333 const CppArgumentList& args, CppVariant* result) { | 1333 const CppArgumentList& args, CppVariant* result) { |
1334 result->SetNull(); | 1334 result->SetNull(); |
1335 if (args.size() < 1 || !args[0].isString()) | 1335 if (args.size() < 1 || !args[0].isString()) |
1336 return; | 1336 return; |
1337 std::wstring counterValue; | 1337 string16 counterValue; |
1338 if (!webkit_glue::CounterValueForElementById(shell_->webView()->mainFrame(), | 1338 if (!webkit_glue::CounterValueForElementById(shell_->webView()->mainFrame(), |
1339 args[0].ToString(), | 1339 args[0].ToString(), |
1340 &counterValue)) | 1340 &counterValue)) |
1341 return; | 1341 return; |
1342 result->Set(WideToUTF8(counterValue)); | 1342 result->Set(UTF16ToUTF8(counterValue)); |
1343 } | 1343 } |
1344 | 1344 |
1345 static bool ParsePageSizeParameters(const CppArgumentList& args, | 1345 static bool ParsePageSizeParameters(const CppArgumentList& args, |
1346 int arg_offset, | 1346 int arg_offset, |
1347 float* page_width_in_pixels, | 1347 float* page_width_in_pixels, |
1348 float* page_height_in_pixels) { | 1348 float* page_height_in_pixels) { |
1349 // WebKit is using the window width/height of DumpRenderTree as the | 1349 // WebKit is using the window width/height of DumpRenderTree as the |
1350 // default value of the page size. | 1350 // default value of the page size. |
1351 // TODO(hamaji): Once chromium DumpRenderTree is implemented, | 1351 // TODO(hamaji): Once chromium DumpRenderTree is implemented, |
1352 // share these values with other ports. | 1352 // share these values with other ports. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 shell_->device_orientation_client_mock()->setOrientation(orientation); | 1540 shell_->device_orientation_client_mock()->setOrientation(orientation); |
1541 } | 1541 } |
1542 | 1542 |
1543 void LayoutTestController::hasSpellingMarker(const CppArgumentList& arguments, | 1543 void LayoutTestController::hasSpellingMarker(const CppArgumentList& arguments, |
1544 CppVariant* result) { | 1544 CppVariant* result) { |
1545 if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber
()) | 1545 if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber
()) |
1546 return; | 1546 return; |
1547 result->Set(shell_->webView()->mainFrame()->selectionStartHasSpellingMarkerFor
( | 1547 result->Set(shell_->webView()->mainFrame()->selectionStartHasSpellingMarkerFor
( |
1548 arguments[0].ToInt32(), arguments[1].ToInt32())); | 1548 arguments[0].ToInt32(), arguments[1].ToInt32())); |
1549 } | 1549 } |
OLD | NEW |