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

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 missed out cases 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 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 1314
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;
1325 1324
1326 for (size_t i = 0; i < optionsArray.size(); ++i) { 1325 for (size_t i = 0; i < optionsArray.size(); ++i) {
1327 const std::string& option = optionsArray[i]; 1326 const std::string& option = optionsArray[i];
1328 // FIXME: Support all the options, so we can run findString.html too .
1329 if (option == "CaseInsensitive") 1327 if (option == "CaseInsensitive")
1330 findOptions.matchCase = false; 1328 findOptions.matchCase = false;
1331 else if (option == "Backwards") 1329 else if (option == "Backwards")
1332 findOptions.forward = false; 1330 findOptions.forward = false;
1331 else if (option == "StartInSelection")
1332 findOptions.findNext = false;
1333 else if (option == "AtWordStarts")
1334 findOptions.wordStart = true;
1335 else if (option == "TreatMedialCapitalAsWordStart")
1336 findOptions.medialCapitalAsWordStart = true;
1333 else if (option == "WrapAround") 1337 else if (option == "WrapAround")
1334 wrapAround = true; 1338 wrapAround = true;
1335 } 1339 }
1336 } 1340 }
1337 1341
1338 WebFrame* frame = m_webView->mainFrame(); 1342 WebFrame* frame = m_webView->mainFrame();
1339 const bool findResult = frame->find(0, cppVariantToWebString(arguments[0]), findOptions, wrapAround, 0); 1343 const bool findResult = frame->find(0, cppVariantToWebString(arguments[0]), findOptions, wrapAround, 0);
1344 frame->stopFinding(false);
1340 result->set(findResult); 1345 result->set(findResult);
1341 } 1346 }
1342 1347
1343 void TestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* r esult) 1348 void TestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* r esult)
1344 { 1349 {
1345 result->setNull(); 1350 result->setNull();
1346 if (arguments.size() != 2) 1351 if (arguments.size() != 2)
1347 return; 1352 return;
1348 1353
1349 WebElement element; 1354 WebElement element;
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 result->setNull(); 2149 result->setNull();
2145 } 2150 }
2146 2151
2147 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result) 2152 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result)
2148 { 2153 {
2149 m_pointerLockPlannedResult = PointerLockWillFailSync; 2154 m_pointerLockPlannedResult = PointerLockWillFailSync;
2150 result->setNull(); 2155 result->setNull();
2151 } 2156 }
2152 2157
2153 } 2158 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698