| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "core/CSSPropertyNames.h" | 9 #include "core/CSSPropertyNames.h" |
| 10 #include "core/HTMLNames.h" | 10 #include "core/HTMLNames.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void WebDocumentTest::LoadURL(const std::string& url) { | 53 void WebDocumentTest::LoadURL(const std::string& url) { |
| 54 web_view_helper_.InitializeAndLoad(url); | 54 web_view_helper_.InitializeAndLoad(url); |
| 55 } | 55 } |
| 56 | 56 |
| 57 Document* WebDocumentTest::TopDocument() const { | 57 Document* WebDocumentTest::TopDocument() const { |
| 58 return ToLocalFrame(web_view_helper_.WebView()->GetPage()->MainFrame()) | 58 return ToLocalFrame(web_view_helper_.WebView()->GetPage()->MainFrame()) |
| 59 ->GetDocument(); | 59 ->GetDocument(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 WebDocument WebDocumentTest::TopWebDocument() const { | 62 WebDocument WebDocumentTest::TopWebDocument() const { |
| 63 return web_view_helper_.WebView()->MainFrameImpl()->GetDocument(); | 63 return web_view_helper_.LocalMainFrame()->GetDocument(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 TEST_F(WebDocumentTest, InsertAndRemoveStyleSheet) { | 66 TEST_F(WebDocumentTest, InsertAndRemoveStyleSheet) { |
| 67 LoadURL("about:blank"); | 67 LoadURL("about:blank"); |
| 68 | 68 |
| 69 WebDocument web_doc = TopWebDocument(); | 69 WebDocument web_doc = TopWebDocument(); |
| 70 Document* core_doc = TopDocument(); | 70 Document* core_doc = TopDocument(); |
| 71 | 71 |
| 72 unsigned start_count = core_doc->GetStyleEngine().StyleForElementCount(); | 72 unsigned start_count = core_doc->GetStyleEngine().StyleForElementCount(); |
| 73 | 73 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b), | 380 ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b), |
| 381 TopDocument()->FirstPartyForCookies()); | 381 TopDocument()->FirstPartyForCookies()); |
| 382 ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b), | 382 ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b), |
| 383 NestedDocument()->FirstPartyForCookies()); | 383 NestedDocument()->FirstPartyForCookies()); |
| 384 ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b), | 384 ASSERT_EQ(ToOriginA(g_nested_origin_a_in_origin_b), |
| 385 NestedNestedDocument()->FirstPartyForCookies()); | 385 NestedNestedDocument()->FirstPartyForCookies()); |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace blink | 388 } // namespace blink |
| OLD | NEW |