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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 EXPECT_EQ("https://www.example.com/hoge", document().outgoingReferrer()); | 317 EXPECT_EQ("https://www.example.com/hoge", document().outgoingReferrer()); |
318 } | 318 } |
319 | 319 |
320 TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin) | 320 TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin) |
321 { | 321 { |
322 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); | 322 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); |
323 document().setSecurityOrigin(SecurityOrigin::createUnique()); | 323 document().setSecurityOrigin(SecurityOrigin::createUnique()); |
324 EXPECT_EQ(String(), document().outgoingReferrer()); | 324 EXPECT_EQ(String(), document().outgoingReferrer()); |
325 } | 325 } |
326 | 326 |
| 327 TEST_F(DocumentTest, StyleVersion) |
| 328 { |
| 329 setHtmlInnerHTML( |
| 330 "<style>" |
| 331 " .a * { color: green }" |
| 332 " .b .c { color: green }" |
| 333 "</style>" |
| 334 "<div id='x'><span class='c'></span></div>"); |
| 335 |
| 336 Element* element = document().getElementById("x"); |
| 337 EXPECT_TRUE(element); |
| 338 |
| 339 uint64_t previousStyleVersion = document().styleVersion(); |
| 340 element->setAttribute(blink::HTMLNames::classAttr, "notfound"); |
| 341 EXPECT_EQ(previousStyleVersion, document().styleVersion()); |
| 342 |
| 343 document().view()->updateAllLifecyclePhases(); |
| 344 |
| 345 previousStyleVersion = document().styleVersion(); |
| 346 element->setAttribute(blink::HTMLNames::classAttr, "a"); |
| 347 EXPECT_NE(previousStyleVersion, document().styleVersion()); |
| 348 |
| 349 document().view()->updateAllLifecyclePhases(); |
| 350 |
| 351 previousStyleVersion = document().styleVersion(); |
| 352 element->setAttribute(blink::HTMLNames::classAttr, "a b"); |
| 353 EXPECT_NE(previousStyleVersion, document().styleVersion()); |
| 354 } |
| 355 |
327 } // namespace blink | 356 } // namespace blink |
OLD | NEW |