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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentStatisticsCollectorTest.cpp

Issue 2812013004: Rewrite references to "wtf/" to "platform/wtf/" in core/{dom,html,xml}. (Closed)
Patch Set: Created 3 years, 8 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 "core/dom/Document.h" 8 #include "core/dom/Document.h"
8 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
9 #include "core/html/HTMLHeadElement.h" 10 #include "core/html/HTMLHeadElement.h"
10 #include "core/html/HTMLLinkElement.h" 11 #include "core/html/HTMLLinkElement.h"
11 #include "core/testing/DummyPageHolder.h" 12 #include "core/testing/DummyPageHolder.h"
13 #include "platform/wtf/text/StringBuilder.h"
12 #include "public/platform/WebDistillability.h" 14 #include "public/platform/WebDistillability.h"
13 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
15 #include "wtf/text/StringBuilder.h"
16 #include <memory>
17 17
18 namespace blink { 18 namespace blink {
19 19
20 // Saturate the length of a paragraph to save time. 20 // Saturate the length of a paragraph to save time.
21 const unsigned kTextContentLengthSaturation = 1000; 21 const unsigned kTextContentLengthSaturation = 1000;
22 22
23 // Filter out short P elements. The threshold is set to around 2 English 23 // Filter out short P elements. The threshold is set to around 2 English
24 // sentences. 24 // sentences.
25 const unsigned kParagraphLengthThreshold = 140; 25 const unsigned kParagraphLengthThreshold = 140;
26 26
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 features.moz_score, 151 features.moz_score,
152 6 * sqrt(kTextContentLengthSaturation - kParagraphLengthThreshold), 152 6 * sqrt(kTextContentLengthSaturation - kParagraphLengthThreshold),
153 error); 153 error);
154 EXPECT_NEAR(features.moz_score_all_sqrt, 154 EXPECT_NEAR(features.moz_score_all_sqrt,
155 6 * sqrt(kTextContentLengthSaturation), error); 155 6 * sqrt(kTextContentLengthSaturation), error);
156 EXPECT_NEAR(features.moz_score_all_linear, 6 * kTextContentLengthSaturation, 156 EXPECT_NEAR(features.moz_score_all_linear, 6 * kTextContentLengthSaturation,
157 error); 157 error);
158 } 158 }
159 159
160 } // namespace blink 160 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698