| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "third_party/WebKit/public/web/WebDocument.h" | 28 #include "third_party/WebKit/public/web/WebDocument.h" |
| 29 #include "third_party/WebKit/public/web/WebElement.h" | 29 #include "third_party/WebKit/public/web/WebElement.h" |
| 30 #include "third_party/WebKit/public/web/WebFrame.h" | 30 #include "third_party/WebKit/public/web/WebFrame.h" |
| 31 #include "third_party/WebKit/public/web/WebNode.h" | 31 #include "third_party/WebKit/public/web/WebNode.h" |
| 32 #include "third_party/WebKit/public/web/WebNodeCollection.h" | 32 #include "third_party/WebKit/public/web/WebNodeCollection.h" |
| 33 #include "third_party/WebKit/public/web/WebNodeList.h" | 33 #include "third_party/WebKit/public/web/WebNodeList.h" |
| 34 #include "third_party/WebKit/public/web/WebPageSerializer.h" | 34 #include "third_party/WebKit/public/web/WebPageSerializer.h" |
| 35 #include "third_party/WebKit/public/web/WebPageSerializerClient.h" | 35 #include "third_party/WebKit/public/web/WebPageSerializerClient.h" |
| 36 #include "third_party/WebKit/public/web/WebView.h" | 36 #include "third_party/WebKit/public/web/WebView.h" |
| 37 | 37 |
| 38 using WebKit::WebCString; | 38 using blink::WebCString; |
| 39 using WebKit::WebData; | 39 using blink::WebData; |
| 40 using WebKit::WebDocument; | 40 using blink::WebDocument; |
| 41 using WebKit::WebElement; | 41 using blink::WebElement; |
| 42 using WebKit::WebFrame; | 42 using blink::WebFrame; |
| 43 using WebKit::WebNode; | 43 using blink::WebNode; |
| 44 using WebKit::WebNodeCollection; | 44 using blink::WebNodeCollection; |
| 45 using WebKit::WebNodeList; | 45 using blink::WebNodeList; |
| 46 using WebKit::WebPageSerializer; | 46 using blink::WebPageSerializer; |
| 47 using WebKit::WebPageSerializerClient; | 47 using blink::WebPageSerializerClient; |
| 48 using WebKit::WebNode; | 48 using blink::WebNode; |
| 49 using WebKit::WebString; | 49 using blink::WebString; |
| 50 using WebKit::WebURL; | 50 using blink::WebURL; |
| 51 using WebKit::WebView; | 51 using blink::WebView; |
| 52 using WebKit::WebVector; | 52 using blink::WebVector; |
| 53 | 53 |
| 54 namespace content { | 54 namespace content { |
| 55 | 55 |
| 56 // Iterate recursively over sub-frames to find one with with a given url. | 56 // Iterate recursively over sub-frames to find one with with a given url. |
| 57 WebFrame* FindSubFrameByURL(WebView* web_view, const GURL& url) { | 57 WebFrame* FindSubFrameByURL(WebView* web_view, const GURL& url) { |
| 58 if (!web_view->mainFrame()) | 58 if (!web_view->mainFrame()) |
| 59 return NULL; | 59 return NULL; |
| 60 | 60 |
| 61 std::vector<WebFrame*> stack; | 61 std::vector<WebFrame*> stack; |
| 62 stack.push_back(web_view->mainFrame()); | 62 stack.push_back(web_view->mainFrame()); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 return true; | 144 return true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 class LoadObserver : public RenderViewObserver { | 147 class LoadObserver : public RenderViewObserver { |
| 148 public: | 148 public: |
| 149 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) | 149 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) |
| 150 : RenderViewObserver(render_view), | 150 : RenderViewObserver(render_view), |
| 151 quit_closure_(quit_closure) {} | 151 quit_closure_(quit_closure) {} |
| 152 | 152 |
| 153 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE { | 153 virtual void DidFinishLoad(blink::WebFrame* frame) OVERRIDE { |
| 154 if (frame == render_view()->GetWebView()->mainFrame()) | 154 if (frame == render_view()->GetWebView()->mainFrame()) |
| 155 quit_closure_.Run(); | 155 quit_closure_.Run(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 base::Closure quit_closure_; | 159 base::Closure quit_closure_; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 class DomSerializerTests : public ContentBrowserTest, | 162 class DomSerializerTests : public ContentBrowserTest, |
| 163 public WebPageSerializerClient { | 163 public WebPageSerializerClient { |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 NavigateToURL(shell(), file_url); | 1002 NavigateToURL(shell(), file_url); |
| 1003 | 1003 |
| 1004 PostTaskToInProcessRendererAndWait( | 1004 PostTaskToInProcessRendererAndWait( |
| 1005 base::Bind( | 1005 base::Bind( |
| 1006 &DomSerializerTests:: | 1006 &DomSerializerTests:: |
| 1007 SubResourceForElementsInNonHTMLNamespaceOnRenderer, | 1007 SubResourceForElementsInNonHTMLNamespaceOnRenderer, |
| 1008 base::Unretained(this), file_url)); | 1008 base::Unretained(this), file_url)); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 } // namespace content | 1011 } // namespace content |
| OLD | NEW |