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

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

Issue 2137483003: Add UMA metrics for root scroller intervention to track forcing passive breakage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ability to test histograms from layout tests Created 4 years, 5 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 #include "core/testing/InternalSettings.h" 121 #include "core/testing/InternalSettings.h"
122 #include "core/testing/LayerRect.h" 122 #include "core/testing/LayerRect.h"
123 #include "core/testing/LayerRectList.h" 123 #include "core/testing/LayerRectList.h"
124 #include "core/testing/MockHyphenation.h" 124 #include "core/testing/MockHyphenation.h"
125 #include "core/testing/PrivateScriptTest.h" 125 #include "core/testing/PrivateScriptTest.h"
126 #include "core/testing/TypeConversions.h" 126 #include "core/testing/TypeConversions.h"
127 #include "core/testing/UnionTypesTest.h" 127 #include "core/testing/UnionTypesTest.h"
128 #include "core/workers/WorkerThread.h" 128 #include "core/workers/WorkerThread.h"
129 #include "gpu/command_buffer/client/gles2_interface.h" 129 #include "gpu/command_buffer/client/gles2_interface.h"
130 #include "platform/Cursor.h" 130 #include "platform/Cursor.h"
131 #include "platform/Histogram.h"
131 #include "platform/Language.h" 132 #include "platform/Language.h"
132 #include "platform/PlatformKeyboardEvent.h" 133 #include "platform/PlatformKeyboardEvent.h"
133 #include "platform/RuntimeEnabledFeatures.h" 134 #include "platform/RuntimeEnabledFeatures.h"
134 #include "platform/TraceEvent.h" 135 #include "platform/TraceEvent.h"
135 #include "platform/geometry/IntRect.h" 136 #include "platform/geometry/IntRect.h"
136 #include "platform/geometry/LayoutRect.h" 137 #include "platform/geometry/LayoutRect.h"
137 #include "platform/graphics/GraphicsLayer.h" 138 #include "platform/graphics/GraphicsLayer.h"
138 #include "platform/heap/Handle.h" 139 #include "platform/heap/Handle.h"
139 #include "platform/inspector_protocol/FrontendChannel.h" 140 #include "platform/inspector_protocol/FrontendChannel.h"
140 #include "platform/scroll/ProgrammaticScrollAnimator.h" 141 #include "platform/scroll/ProgrammaticScrollAnimator.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 exceptionState.throwDOMException(InvalidAccessError, "Must supply docume nt to check"); 380 exceptionState.throwDOMException(InvalidAccessError, "Must supply docume nt to check");
380 return; 381 return;
381 } 382 }
382 383
383 if (doc->layoutViewItem().isNull()) 384 if (doc->layoutViewItem().isNull())
384 return; 385 return;
385 386
386 doc->layoutViewItem().clearHitTestCache(); 387 doc->layoutViewItem().clearHitTestCache();
387 } 388 }
388 389
390 int Internals::histogramCount(const String& name, int bucket, ExceptionState& ex ceptionState) const
391 {
392 int32_t count;
393 if (!EnumerationHistogram::GetHistogramCount(name.utf8().data(), bucket, &co unt)) {
394 exceptionState.throwDOMException(InvalidAccessError, "Could not find his togram");
395 return 0;
396 }
397 return count;
398 }
399
389 bool Internals::isPreloaded(const String& url) 400 bool Internals::isPreloaded(const String& url)
390 { 401 {
391 return isPreloadedBy(url, contextDocument()); 402 return isPreloadedBy(url, contextDocument());
392 } 403 }
393 404
394 bool Internals::isPreloadedBy(const String& url, Document* document) 405 bool Internals::isPreloadedBy(const String& url, Document* document)
395 { 406 {
396 if (!document) 407 if (!document)
397 return false; 408 return false;
398 return document->fetcher()->isPreloaded(document->completeURL(url)); 409 return document->fetcher()->isPreloaded(document->completeURL(url));
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 } 2641 }
2631 2642
2632 String Internals::getProgrammaticScrollAnimationState(Node* node) const 2643 String Internals::getProgrammaticScrollAnimationState(Node* node) const
2633 { 2644 {
2634 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) 2645 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node))
2635 return scrollableArea->programmaticScrollAnimator().runStateAsText(); 2646 return scrollableArea->programmaticScrollAnimator().runStateAsText();
2636 return String(); 2647 return String();
2637 } 2648 }
2638 2649
2639 } // namespace blink 2650 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698