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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 treeScope1 ? "second" : "first")); 548 treeScope1 ? "second" : "first"));
549 return 0; 549 return 0;
550 } 550 }
551 return treeScope1->comparePosition(*treeScope2); 551 return treeScope1->comparePosition(*treeScope2);
552 } 552 }
553 553
554 void Internals::pauseAnimations(double pauseTime, 554 void Internals::pauseAnimations(double pauseTime,
555 ExceptionState& exceptionState) { 555 ExceptionState& exceptionState) {
556 if (pauseTime < 0) { 556 if (pauseTime < 0) {
557 exceptionState.throwDOMException( 557 exceptionState.throwDOMException(
558 InvalidAccessError, ExceptionMessages::indexExceedsMinimumBound( 558 InvalidAccessError,
559 "pauseTime", pauseTime, 0.0)); 559 ExceptionMessages::indexExceedsMinimumBound("pauseTime", pauseTime,
560 0.0));
560 return; 561 return;
561 } 562 }
562 563
563 if (!frame()) 564 if (!frame())
564 return; 565 return;
565 566
566 frame()->view()->updateAllLifecyclePhases(); 567 frame()->view()->updateAllLifecyclePhases();
567 frame()->document()->timeline().pauseAnimationsForTesting(pauseTime); 568 frame()->document()->timeline().pauseAnimationsForTesting(pauseTime);
568 } 569 }
569 570
570 bool Internals::isCompositedAnimation(Animation* animation) { 571 bool Internals::isCompositedAnimation(Animation* animation) {
571 return animation->hasActiveAnimationsOnCompositor(); 572 return animation->hasActiveAnimationsOnCompositor();
572 } 573 }
573 574
574 void Internals::disableCompositedAnimation(Animation* animation) { 575 void Internals::disableCompositedAnimation(Animation* animation) {
575 animation->disableCompositedAnimationForTesting(); 576 animation->disableCompositedAnimationForTesting();
576 } 577 }
577 578
578 void Internals::disableCSSAdditiveAnimations() { 579 void Internals::disableCSSAdditiveAnimations() {
579 RuntimeEnabledFeatures::setCSSAdditiveAnimationsEnabled(false); 580 RuntimeEnabledFeatures::setCSSAdditiveAnimationsEnabled(false);
580 } 581 }
581 582
582 void Internals::advanceTimeForImage(Element* image, 583 void Internals::advanceTimeForImage(Element* image,
583 double deltaTimeInSeconds, 584 double deltaTimeInSeconds,
584 ExceptionState& exceptionState) { 585 ExceptionState& exceptionState) {
585 DCHECK(image); 586 DCHECK(image);
586 if (deltaTimeInSeconds < 0) { 587 if (deltaTimeInSeconds < 0) {
587 exceptionState.throwDOMException( 588 exceptionState.throwDOMException(
588 InvalidAccessError, ExceptionMessages::indexExceedsMinimumBound( 589 InvalidAccessError,
589 "deltaTimeInSeconds", deltaTimeInSeconds, 0.0)); 590 ExceptionMessages::indexExceedsMinimumBound("deltaTimeInSeconds",
591 deltaTimeInSeconds, 0.0));
590 return; 592 return;
591 } 593 }
592 594
593 ImageResourceContent* resource = nullptr; 595 ImageResourceContent* resource = nullptr;
594 if (isHTMLImageElement(*image)) { 596 if (isHTMLImageElement(*image)) {
595 resource = toHTMLImageElement(*image).cachedImage(); 597 resource = toHTMLImageElement(*image).cachedImage();
596 } else if (isSVGImageElement(*image)) { 598 } else if (isSVGImageElement(*image)) {
597 resource = toSVGImageElement(*image).cachedImage(); 599 resource = toSVGImageElement(*image).cachedImage();
598 } else { 600 } else {
599 exceptionState.throwDOMException( 601 exceptionState.throwDOMException(
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 } 1292 }
1291 1293
1292 document->updateStyleAndLayout(); 1294 document->updateStyleAndLayout();
1293 1295
1294 IntSize radius(width / 2, height / 2); 1296 IntSize radius(width / 2, height / 2);
1295 IntPoint point(x + radius.width(), y + radius.height()); 1297 IntPoint point(x + radius.width(), y + radius.height());
1296 1298
1297 EventHandler& eventHandler = document->frame()->eventHandler(); 1299 EventHandler& eventHandler = document->frame()->eventHandler();
1298 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point); 1300 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point);
1299 HitTestResult result = eventHandler.hitTestResultAtPoint( 1301 HitTestResult result = eventHandler.hitTestResultAtPoint(
1300 hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | 1302 hitTestPoint,
1301 HitTestRequest::ListBased, 1303 HitTestRequest::ReadOnly | HitTestRequest::Active |
1304 HitTestRequest::ListBased,
1302 LayoutSize(radius)); 1305 LayoutSize(radius));
1303 1306
1304 Node* targetNode = 0; 1307 Node* targetNode = 0;
1305 IntPoint adjustedPoint; 1308 IntPoint adjustedPoint;
1306 1309
1307 bool foundNode = eventHandler.bestClickableNodeForHitTestResult( 1310 bool foundNode = eventHandler.bestClickableNodeForHitTestResult(
1308 result, adjustedPoint, targetNode); 1311 result, adjustedPoint, targetNode);
1309 if (foundNode) 1312 if (foundNode)
1310 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); 1313 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y());
1311 1314
(...skipping 15 matching lines...) Expand all
1327 } 1330 }
1328 1331
1329 document->updateStyleAndLayout(); 1332 document->updateStyleAndLayout();
1330 1333
1331 IntSize radius(width / 2, height / 2); 1334 IntSize radius(width / 2, height / 2);
1332 IntPoint point(x + radius.width(), y + radius.height()); 1335 IntPoint point(x + radius.width(), y + radius.height());
1333 1336
1334 EventHandler& eventHandler = document->frame()->eventHandler(); 1337 EventHandler& eventHandler = document->frame()->eventHandler();
1335 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point); 1338 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point);
1336 HitTestResult result = eventHandler.hitTestResultAtPoint( 1339 HitTestResult result = eventHandler.hitTestResultAtPoint(
1337 hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | 1340 hitTestPoint,
1338 HitTestRequest::ListBased, 1341 HitTestRequest::ReadOnly | HitTestRequest::Active |
1342 HitTestRequest::ListBased,
1339 LayoutSize(radius)); 1343 LayoutSize(radius));
1340 1344
1341 Node* targetNode = 0; 1345 Node* targetNode = 0;
1342 IntPoint adjustedPoint; 1346 IntPoint adjustedPoint;
1343 document->frame()->eventHandler().bestClickableNodeForHitTestResult( 1347 document->frame()->eventHandler().bestClickableNodeForHitTestResult(
1344 result, adjustedPoint, targetNode); 1348 result, adjustedPoint, targetNode);
1345 return targetNode; 1349 return targetNode;
1346 } 1350 }
1347 1351
1348 DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode( 1352 DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(
(...skipping 11 matching lines...) Expand all
1360 } 1364 }
1361 1365
1362 document->updateStyleAndLayout(); 1366 document->updateStyleAndLayout();
1363 1367
1364 IntSize radius(width / 2, height / 2); 1368 IntSize radius(width / 2, height / 2);
1365 IntPoint point(x + radius.width(), y + radius.height()); 1369 IntPoint point(x + radius.width(), y + radius.height());
1366 1370
1367 EventHandler& eventHandler = document->frame()->eventHandler(); 1371 EventHandler& eventHandler = document->frame()->eventHandler();
1368 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point); 1372 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point);
1369 HitTestResult result = eventHandler.hitTestResultAtPoint( 1373 HitTestResult result = eventHandler.hitTestResultAtPoint(
1370 hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | 1374 hitTestPoint,
1371 HitTestRequest::ListBased, 1375 HitTestRequest::ReadOnly | HitTestRequest::Active |
1376 HitTestRequest::ListBased,
1372 LayoutSize(radius)); 1377 LayoutSize(radius));
1373 1378
1374 Node* targetNode = 0; 1379 Node* targetNode = 0;
1375 IntPoint adjustedPoint; 1380 IntPoint adjustedPoint;
1376 1381
1377 bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult( 1382 bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult(
1378 result, adjustedPoint, targetNode); 1383 result, adjustedPoint, targetNode);
1379 if (foundNode) 1384 if (foundNode)
1380 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); 1385 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y());
1381 1386
(...skipping 15 matching lines...) Expand all
1397 } 1402 }
1398 1403
1399 document->updateStyleAndLayout(); 1404 document->updateStyleAndLayout();
1400 1405
1401 IntSize radius(width / 2, height / 2); 1406 IntSize radius(width / 2, height / 2);
1402 IntPoint point(x + radius.width(), y + radius.height()); 1407 IntPoint point(x + radius.width(), y + radius.height());
1403 1408
1404 EventHandler& eventHandler = document->frame()->eventHandler(); 1409 EventHandler& eventHandler = document->frame()->eventHandler();
1405 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point); 1410 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point);
1406 HitTestResult result = eventHandler.hitTestResultAtPoint( 1411 HitTestResult result = eventHandler.hitTestResultAtPoint(
1407 hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | 1412 hitTestPoint,
1408 HitTestRequest::ListBased, 1413 HitTestRequest::ReadOnly | HitTestRequest::Active |
1414 HitTestRequest::ListBased,
1409 LayoutSize(radius)); 1415 LayoutSize(radius));
1410 1416
1411 Node* targetNode = 0; 1417 Node* targetNode = 0;
1412 IntPoint adjustedPoint; 1418 IntPoint adjustedPoint;
1413 eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint, 1419 eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint,
1414 targetNode); 1420 targetNode);
1415 return targetNode; 1421 return targetNode;
1416 } 1422 }
1417 1423
1418 ClientRect* Internals::bestZoomableAreaForTouchPoint( 1424 ClientRect* Internals::bestZoomableAreaForTouchPoint(
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
3119 3125
3120 void Internals::crash() { 3126 void Internals::crash() {
3121 CHECK(false) << "Intentional crash"; 3127 CHECK(false) << "Intentional crash";
3122 } 3128 }
3123 3129
3124 void Internals::setIsLowEndDevice(bool isLowEndDevice) { 3130 void Internals::setIsLowEndDevice(bool isLowEndDevice) {
3125 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); 3131 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice);
3126 } 3132 }
3127 3133
3128 } // namespace blink 3134 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/InternalSettings.cpp ('k') | third_party/WebKit/Source/core/testing/UnionTypesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698