| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "public/web/WebDocument.h" | 5 #include "public/web/WebDocument.h" |
| 6 | 6 |
| 7 #include "core/CSSPropertyNames.h" | 7 #include "core/CSSPropertyNames.h" |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/dom/NodeComputedStyle.h" | 9 #include "core/dom/NodeComputedStyle.h" |
| 10 #include "core/dom/StyleEngine.h" | 10 #include "core/dom/StyleEngine.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 HTMLElement* bodyElement = coreDoc->body(); | 78 HTMLElement* bodyElement = coreDoc->body(); |
| 79 DCHECK(bodyElement); | 79 DCHECK(bodyElement); |
| 80 | 80 |
| 81 const ComputedStyle& styleBeforeInsertion = bodyElement->computedStyleRef(); | 81 const ComputedStyle& styleBeforeInsertion = bodyElement->computedStyleRef(); |
| 82 | 82 |
| 83 // Inserted stylesheet not yet applied. | 83 // Inserted stylesheet not yet applied. |
| 84 ASSERT_EQ(Color(0, 0, 0), styleBeforeInsertion.visitedDependentColor(CSSProp
ertyColor)); | 84 ASSERT_EQ(Color(0, 0, 0), styleBeforeInsertion.visitedDependentColor(CSSProp
ertyColor)); |
| 85 | 85 |
| 86 // Apply inserted stylesheet. | 86 // Apply inserted stylesheet. |
| 87 coreDoc->updateLayoutTree(); | 87 coreDoc->updateStyleAndLayoutTree(); |
| 88 | 88 |
| 89 const ComputedStyle& styleAfterInsertion = bodyElement->computedStyleRef(); | 89 const ComputedStyle& styleAfterInsertion = bodyElement->computedStyleRef(); |
| 90 | 90 |
| 91 // Inserted stylesheet applied. | 91 // Inserted stylesheet applied. |
| 92 ASSERT_EQ(Color(0, 128, 0), styleAfterInsertion.visitedDependentColor(CSSPro
pertyColor)); | 92 ASSERT_EQ(Color(0, 128, 0), styleAfterInsertion.visitedDependentColor(CSSPro
pertyColor)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 TEST_F(WebDocumentTest, ManifestURL) | 95 TEST_F(WebDocumentTest, ManifestURL) |
| 96 { | 96 { |
| 97 loadURL(std::string(kDefaultOrigin) + kManifestDummyFilePath); | 97 loadURL(std::string(kDefaultOrigin) + kManifestDummyFilePath); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 load(nestedOriginAInOriginB); | 320 load(nestedOriginAInOriginB); |
| 321 | 321 |
| 322 SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel("http"); | 322 SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel("http"); |
| 323 | 323 |
| 324 ASSERT_EQ(toOriginA(nestedOriginAInOriginB), topDocument()->firstPartyForCoo
kies()); | 324 ASSERT_EQ(toOriginA(nestedOriginAInOriginB), topDocument()->firstPartyForCoo
kies()); |
| 325 ASSERT_EQ(toOriginA(nestedOriginAInOriginB), nestedDocument()->firstPartyFor
Cookies()); | 325 ASSERT_EQ(toOriginA(nestedOriginAInOriginB), nestedDocument()->firstPartyFor
Cookies()); |
| 326 ASSERT_EQ(toOriginA(nestedOriginAInOriginB), nestedNestedDocument()->firstPa
rtyForCookies()); | 326 ASSERT_EQ(toOriginA(nestedOriginAInOriginB), nestedNestedDocument()->firstPa
rtyForCookies()); |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace blink | 329 } // namespace blink |
| OLD | NEW |