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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentStatisticsCollectorTest.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "core/dom/DocumentStatisticsCollector.h" 5 #include "core/dom/DocumentStatisticsCollector.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/html/HTMLHeadElement.h" 10 #include "core/html/HTMLHeadElement.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 for (int j = 0; j < 1000; j++) { 140 for (int j = 0; j < 1000; j++) {
141 html.append("0123456789"); 141 html.append("0123456789");
142 } 142 }
143 html.append("</p>"); 143 html.append("</p>");
144 } 144 }
145 setHtmlInnerHTML(html.toString()); 145 setHtmlInnerHTML(html.toString());
146 WebDistillabilityFeatures features = 146 WebDistillabilityFeatures features =
147 DocumentStatisticsCollector::collectStatistics(document()); 147 DocumentStatisticsCollector::collectStatistics(document());
148 148
149 double error = 1e-5; 149 double error = 1e-5;
150 EXPECT_NEAR(features.mozScore, 6 * sqrt(kTextContentLengthSaturation - 150 EXPECT_NEAR(
151 kParagraphLengthThreshold), 151 features.mozScore,
152 error); 152 6 * sqrt(kTextContentLengthSaturation - kParagraphLengthThreshold),
153 error);
153 EXPECT_NEAR(features.mozScoreAllSqrt, 6 * sqrt(kTextContentLengthSaturation), 154 EXPECT_NEAR(features.mozScoreAllSqrt, 6 * sqrt(kTextContentLengthSaturation),
154 error); 155 error);
155 EXPECT_NEAR(features.mozScoreAllLinear, 6 * kTextContentLengthSaturation, 156 EXPECT_NEAR(features.mozScoreAllLinear, 6 * kTextContentLengthSaturation,
156 error); 157 error);
157 } 158 }
158 159
159 } // namespace blink 160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentLifecycle.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698