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

Side by Side Diff: components/dom_distiller/core/page_features_unittest.cc

Issue 1680103003: Match the derived features to the training data set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style Created 4 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
« no previous file with comments | « components/dom_distiller/core/page_features.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/dom_distiller/core/page_features.h" 5 #include "components/dom_distiller/core/page_features.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 EXPECT_EQ(0, lround(derived[4])); 162 EXPECT_EQ(0, lround(derived[4]));
163 EXPECT_EQ(0, lround(derived[5])); 163 EXPECT_EQ(0, lround(derived[5]));
164 EXPECT_EQ(0, lround(derived[6])); 164 EXPECT_EQ(0, lround(derived[6]));
165 EXPECT_EQ(0, lround(derived[7])); 165 EXPECT_EQ(0, lround(derived[7]));
166 EXPECT_EQ(0, lround(derived[8])); 166 EXPECT_EQ(0, lround(derived[8]));
167 EXPECT_EQ(1, lround(derived[9])); 167 EXPECT_EQ(1, lround(derived[9]));
168 EXPECT_EQ(1, lround(derived[10])); 168 EXPECT_EQ(1, lround(derived[10]));
169 EXPECT_EQ(0, lround(derived[11])); 169 EXPECT_EQ(0, lround(derived[11]));
170 EXPECT_EQ(0, lround(derived[12])); 170 EXPECT_EQ(0, lround(derived[12]));
171 EXPECT_EQ(0, lround(derived[13])); 171 EXPECT_EQ(0, lround(derived[13]));
172 EXPECT_EQ(0, lround(derived[14])); 172 EXPECT_EQ(1, lround(derived[14]));
173 }
174
175 TEST(DomDistillerPageFeaturesTest, TestPath4) {
176 GURL url("https://example.com/trailing/");
177
178 std::vector<double> derived(DeriveFromPath(url));
179 EXPECT_EQ(0, lround(derived[1]));
180 EXPECT_EQ(0, lround(derived[2]));
181 EXPECT_EQ(0, lround(derived[3]));
182 EXPECT_EQ(0, lround(derived[4]));
183 EXPECT_EQ(0, lround(derived[5]));
184 EXPECT_EQ(0, lround(derived[6]));
185 EXPECT_EQ(0, lround(derived[7]));
186 EXPECT_EQ(0, lround(derived[8]));
187 EXPECT_EQ(10, lround(derived[9]));
188 EXPECT_EQ(0, lround(derived[10]));
189 EXPECT_EQ(1, lround(derived[11]));
190 EXPECT_EQ(0, lround(derived[12]));
191 EXPECT_EQ(0, lround(derived[13]));
192 EXPECT_EQ(9, lround(derived[14]));
173 } 193 }
174 } 194 }
OLDNEW
« no previous file with comments | « components/dom_distiller/core/page_features.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698