OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 | 8 |
9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
10 #include "Document.h" | 10 #include "Document.h" |
11 #include "DocumentType.h" | 11 #include "DocumentType.h" |
12 #include "Element.h" | 12 #include "Element.h" |
13 #include "FrameLoader.h" | 13 #include "FrameLoader.h" |
14 #include "FrameView.h" | 14 #include "FrameView.h" |
15 #include "HTMLCollection.h" | 15 #include "HTMLAllCollection.h" |
16 #include "HTMLHeadElement.h" | 16 #include "HTMLHeadElement.h" |
17 #include "HTMLMetaElement.h" | 17 #include "HTMLMetaElement.h" |
18 #include "HTMLNames.h" | 18 #include "HTMLNames.h" |
19 #include "KURL.h" | 19 #include "KURL.h" |
20 #include "markup.h" | 20 #include "markup.h" |
21 #include "SharedBuffer.h" | 21 #include "SharedBuffer.h" |
22 #include "SubstituteData.h" | 22 #include "SubstituteData.h" |
23 MSVC_POP_WARNING(); | 23 MSVC_POP_WARNING(); |
24 #undef LOG | 24 #undef LOG |
25 | 25 |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 // Since for this test, we assume there is no savable sub-resource links for | 665 // Since for this test, we assume there is no savable sub-resource links for |
666 // this test file, also all links are relative URLs in this test file, so we | 666 // this test file, also all links are relative URLs in this test file, so we |
667 // need to check those relative URLs and make sure document has BASE tag. | 667 // need to check those relative URLs and make sure document has BASE tag. |
668 WebFrameImpl* web_frame = | 668 WebFrameImpl* web_frame = |
669 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( | 669 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( |
670 test_shell_->webView(), file_url); | 670 test_shell_->webView(), file_url); |
671 ASSERT_TRUE(web_frame != NULL); | 671 ASSERT_TRUE(web_frame != NULL); |
672 WebCore::Document* doc = web_frame->frame()->document(); | 672 WebCore::Document* doc = web_frame->frame()->document(); |
673 ASSERT_TRUE(doc->isHTMLDocument()); | 673 ASSERT_TRUE(doc->isHTMLDocument()); |
674 // Go through all descent nodes. | 674 // Go through all descent nodes. |
675 RefPtr<WebCore::HTMLCollection> all = doc->all(); | 675 RefPtr<WebCore::HTMLAllCollection> all = doc->all(); |
676 int original_base_tag_count = 0; | 676 int original_base_tag_count = 0; |
677 for (WebCore::Node* node = all->firstItem(); node != NULL; | 677 for (WebCore::Node* node = all->firstItem(); node != NULL; |
678 node = all->nextItem()) { | 678 node = all->nextItem()) { |
679 if (!node->isHTMLElement()) | 679 if (!node->isHTMLElement()) |
680 continue; | 680 continue; |
681 WebCore::Element* element = static_cast<WebCore::Element*>(node); | 681 WebCore::Element* element = static_cast<WebCore::Element*>(node); |
682 if (element->hasTagName(WebCore::HTMLNames::baseTag)) { | 682 if (element->hasTagName(WebCore::HTMLNames::baseTag)) { |
683 original_base_tag_count++; | 683 original_base_tag_count++; |
684 } else { | 684 } else { |
685 // Get link. | 685 // Get link. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 // "hello world" | 809 // "hello world" |
810 WebCore::HTMLElement* body_ele = doc->body(); | 810 WebCore::HTMLElement* body_ele = doc->body(); |
811 ASSERT_TRUE(body_ele != NULL); | 811 ASSERT_TRUE(body_ele != NULL); |
812 WebCore::Node* text_node = body_ele->firstChild(); | 812 WebCore::Node* text_node = body_ele->firstChild(); |
813 ASSERT_TRUE(text_node->isTextNode()); | 813 ASSERT_TRUE(text_node->isTextNode()); |
814 const WebCore::String& text_node_contents = text_node->nodeValue(); | 814 const WebCore::String& text_node_contents = text_node->nodeValue(); |
815 ASSERT_TRUE(text_node_contents == WebCore::String("hello world")); | 815 ASSERT_TRUE(text_node_contents == WebCore::String("hello world")); |
816 } | 816 } |
817 | 817 |
818 } // namespace | 818 } // namespace |
OLD | NEW |