| OLD | NEW |
| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 for (auto test : tests) { | 279 for (auto test : tests) { |
| 280 document().setReferrerPolicy(ReferrerPolicyDefault); | 280 document().setReferrerPolicy(ReferrerPolicyDefault); |
| 281 | 281 |
| 282 document().processReferrerPolicy(test.policy); | 282 document().processReferrerPolicy(test.policy); |
| 283 EXPECT_EQ(test.expected, document().getReferrerPolicy()) << test.policy; | 283 EXPECT_EQ(test.expected, document().getReferrerPolicy()) << test.policy; |
| 284 } | 284 } |
| 285 } | 285 } |
| 286 | 286 |
| 287 // This tests that we mark Frame Timing requests as dirty correctly when we | |
| 288 // update style. | |
| 289 TEST_F(DocumentTest, FrameTimingRelayout) | |
| 290 { | |
| 291 setHtmlInnerHTML( | |
| 292 "<style>" | |
| 293 " #div1 {" | |
| 294 " width: 100px;" | |
| 295 " height: 100px;" | |
| 296 " }" | |
| 297 "</style>" | |
| 298 "<p><div id='div1'><span>test</span></div></p>"); | |
| 299 | |
| 300 EXPECT_FALSE(document().view()->frameTimingRequestsDirty()); | |
| 301 | |
| 302 // Just calling update should have no effect. | |
| 303 document().updateLayoutTree(); | |
| 304 EXPECT_FALSE(document().view()->frameTimingRequestsDirty()); | |
| 305 | |
| 306 // Calling update with a style change should flag Frame Timing as dirty. | |
| 307 document().setChildNeedsStyleRecalc(); | |
| 308 document().updateLayoutTree(); | |
| 309 EXPECT_TRUE(document().view()->frameTimingRequestsDirty()); | |
| 310 } | |
| 311 | |
| 312 TEST_F(DocumentTest, OutgoingReferrer) | 287 TEST_F(DocumentTest, OutgoingReferrer) |
| 313 { | 288 { |
| 314 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); | 289 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); |
| 315 document().setSecurityOrigin(SecurityOrigin::create(KURL(KURL(), "https://ww
w.example.com/"))); | 290 document().setSecurityOrigin(SecurityOrigin::create(KURL(KURL(), "https://ww
w.example.com/"))); |
| 316 EXPECT_EQ("https://www.example.com/hoge", document().outgoingReferrer()); | 291 EXPECT_EQ("https://www.example.com/hoge", document().outgoingReferrer()); |
| 317 } | 292 } |
| 318 | 293 |
| 319 TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin) | 294 TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin) |
| 320 { | 295 { |
| 321 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); | 296 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 EXPECT_TRUE(document().getSecurityOrigin()->isPotentiallyTrustworthy()); | 357 EXPECT_TRUE(document().getSecurityOrigin()->isPotentiallyTrustworthy()); |
| 383 | 358 |
| 384 origin = SecurityOrigin::createFromString("https://example.test"); | 359 origin = SecurityOrigin::createFromString("https://example.test"); |
| 385 document().setSecurityOrigin(origin); | 360 document().setSecurityOrigin(origin); |
| 386 document().enforceSandboxFlags(mask); | 361 document().enforceSandboxFlags(mask); |
| 387 EXPECT_TRUE(document().getSecurityOrigin()->isUnique()); | 362 EXPECT_TRUE(document().getSecurityOrigin()->isUnique()); |
| 388 EXPECT_TRUE(document().getSecurityOrigin()->isPotentiallyTrustworthy()); | 363 EXPECT_TRUE(document().getSecurityOrigin()->isPotentiallyTrustworthy()); |
| 389 } | 364 } |
| 390 | 365 |
| 391 } // namespace blink | 366 } // namespace blink |
| OLD | NEW |