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

Side by Side Diff: Source/testing/runner/TestRunner.cpp

Issue 26654011: Fixing TestRunner::findString() so as to fix findString.html editing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing default initializations Created 7 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) 3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
4 * Copyright (C) 2012 Apple Inc. All Rights Reserved. 4 * Copyright (C) 2012 Apple Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 void TestRunner::findString(const CppArgumentList& arguments, CppVariant* result ) 1315 void TestRunner::findString(const CppArgumentList& arguments, CppVariant* result )
1316 { 1316 {
1317 if (arguments.size() < 1 || !arguments[0].isString()) 1317 if (arguments.size() < 1 || !arguments[0].isString())
1318 return; 1318 return;
1319 1319
1320 WebFindOptions findOptions; 1320 WebFindOptions findOptions;
1321 bool wrapAround = false; 1321 bool wrapAround = false;
1322 if (arguments.size() >= 2) { 1322 if (arguments.size() >= 2) {
1323 vector<string> optionsArray = arguments[1].toStringVector(); 1323 vector<string> optionsArray = arguments[1].toStringVector();
1324 findOptions.matchCase = true; 1324 findOptions.matchCase = true;
1325 findOptions.findNext = true;
1325 1326
1326 for (size_t i = 0; i < optionsArray.size(); ++i) { 1327 for (size_t i = 0; i < optionsArray.size(); ++i) {
1327 const std::string& option = optionsArray[i]; 1328 const std::string& option = optionsArray[i];
1328 // FIXME: Support all the options, so we can run findString.html too .
1329 if (option == "CaseInsensitive") 1329 if (option == "CaseInsensitive")
1330 findOptions.matchCase = false; 1330 findOptions.matchCase = false;
1331 else if (option == "Backwards") 1331 else if (option == "Backwards")
1332 findOptions.forward = false; 1332 findOptions.forward = false;
1333 else if (option == "StartInSelection")
1334 findOptions.findNext = false;
1335 else if (option == "AtWordStarts")
1336 findOptions.wordStart = true;
1337 else if (option == "TreatMedialCapitalAsWordStart")
1338 findOptions.medialCapitalAsWordStart = true;
1333 else if (option == "WrapAround") 1339 else if (option == "WrapAround")
1334 wrapAround = true; 1340 wrapAround = true;
1335 } 1341 }
1336 } 1342 }
1337 1343
1338 WebFrame* frame = m_webView->mainFrame(); 1344 WebFrame* frame = m_webView->mainFrame();
1339 const bool findResult = frame->find(0, cppVariantToWebString(arguments[0]), findOptions, wrapAround, 0); 1345 const bool findResult = frame->find(0, cppVariantToWebString(arguments[0]), findOptions, wrapAround, 0);
1346 frame->stopFinding(false);
1340 result->set(findResult); 1347 result->set(findResult);
1341 } 1348 }
1342 1349
1343 void TestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* r esult) 1350 void TestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* r esult)
1344 { 1351 {
1345 result->setNull(); 1352 result->setNull();
1346 if (arguments.size() != 2) 1353 if (arguments.size() != 2)
1347 return; 1354 return;
1348 1355
1349 WebElement element; 1356 WebElement element;
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 result->setNull(); 2151 result->setNull();
2145 } 2152 }
2146 2153
2147 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result) 2154 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result)
2148 { 2155 {
2149 m_pointerLockPlannedResult = PointerLockWillFailSync; 2156 m_pointerLockPlannedResult = PointerLockWillFailSync;
2150 result->setNull(); 2157 result->setNull();
2151 } 2158 }
2152 2159
2153 } 2160 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/text-iterator/findString-restarts-at-last-position-expected.txt ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698