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

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

Issue 1738613002: Rename enums/functions that collide in chromium style in core/dom/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-names-3
Patch Set: get-names-4: Created 4 years, 9 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) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 link->setAttribute(blink::HTMLNames::typeAttr, "image/gif"); 252 link->setAttribute(blink::HTMLNames::typeAttr, "image/gif");
253 EXPECT_EQ(link, document().linkManifest()); 253 EXPECT_EQ(link, document().linkManifest());
254 link->setAttribute(blink::HTMLNames::sizesAttr, "16x16"); 254 link->setAttribute(blink::HTMLNames::sizesAttr, "16x16");
255 EXPECT_EQ(link, document().linkManifest()); 255 EXPECT_EQ(link, document().linkManifest());
256 link->setAttribute(blink::HTMLNames::mediaAttr, "print"); 256 link->setAttribute(blink::HTMLNames::mediaAttr, "print");
257 EXPECT_EQ(link, document().linkManifest()); 257 EXPECT_EQ(link, document().linkManifest());
258 } 258 }
259 259
260 TEST_F(DocumentTest, referrerPolicyParsing) 260 TEST_F(DocumentTest, referrerPolicyParsing)
261 { 261 {
262 EXPECT_EQ(ReferrerPolicyDefault, document().referrerPolicy()); 262 EXPECT_EQ(ReferrerPolicyDefault, document().getReferrerPolicy());
263 263
264 struct TestCase { 264 struct TestCase {
265 const char* policy; 265 const char* policy;
266 ReferrerPolicy expected; 266 ReferrerPolicy expected;
267 } tests[] = { 267 } tests[] = {
268 { "always", ReferrerPolicyAlways }, 268 { "always", ReferrerPolicyAlways },
269 { "default", ReferrerPolicyNoReferrerWhenDowngrade }, 269 { "default", ReferrerPolicyNoReferrerWhenDowngrade },
270 { "never", ReferrerPolicyNever }, 270 { "never", ReferrerPolicyNever },
271 { "no-referrer", ReferrerPolicyNever }, 271 { "no-referrer", ReferrerPolicyNever },
272 { "no-referrer-when-downgrade", ReferrerPolicyNoReferrerWhenDowngrade }, 272 { "no-referrer-when-downgrade", ReferrerPolicyNoReferrerWhenDowngrade },
273 { "not-a-real-policy", ReferrerPolicyDefault }, 273 { "not-a-real-policy", ReferrerPolicyDefault },
274 { "origin", ReferrerPolicyOrigin }, 274 { "origin", ReferrerPolicyOrigin },
275 { "origin-when-crossorigin", ReferrerPolicyOriginWhenCrossOrigin }, 275 { "origin-when-crossorigin", ReferrerPolicyOriginWhenCrossOrigin },
276 { "origin-when-cross-origin", ReferrerPolicyOriginWhenCrossOrigin }, 276 { "origin-when-cross-origin", ReferrerPolicyOriginWhenCrossOrigin },
277 { "unsafe-url", ReferrerPolicyAlways }, 277 { "unsafe-url", ReferrerPolicyAlways },
278 }; 278 };
279 279
280 for (auto test : tests) { 280 for (auto test : tests) {
281 document().setReferrerPolicy(ReferrerPolicyDefault); 281 document().setReferrerPolicy(ReferrerPolicyDefault);
282 282
283 document().processReferrerPolicy(test.policy); 283 document().processReferrerPolicy(test.policy);
284 EXPECT_EQ(test.expected, document().referrerPolicy()) << test.policy; 284 EXPECT_EQ(test.expected, document().getReferrerPolicy()) << test.policy;
285 } 285 }
286 } 286 }
287 287
288 // This tests that we mark Frame Timing requests as dirty correctly when we 288 // This tests that we mark Frame Timing requests as dirty correctly when we
289 // update style. 289 // update style.
290 TEST_F(DocumentTest, FrameTimingRelayout) 290 TEST_F(DocumentTest, FrameTimingRelayout)
291 { 291 {
292 setHtmlInnerHTML( 292 setHtmlInnerHTML(
293 "<style>" 293 "<style>"
294 " #div1 {" 294 " #div1 {"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 EXPECT_NE(previousStyleVersion, document().styleVersion()); 347 EXPECT_NE(previousStyleVersion, document().styleVersion());
348 348
349 document().view()->updateAllLifecyclePhases(); 349 document().view()->updateAllLifecyclePhases();
350 350
351 previousStyleVersion = document().styleVersion(); 351 previousStyleVersion = document().styleVersion();
352 element->setAttribute(blink::HTMLNames::classAttr, "a b"); 352 element->setAttribute(blink::HTMLNames::classAttr, "a b");
353 EXPECT_NE(previousStyleVersion, document().styleVersion()); 353 EXPECT_NE(previousStyleVersion, document().styleVersion());
354 } 354 }
355 355
356 } // namespace blink 356 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698