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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) | 68 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) |
69 : RenderViewObserver(render_view), | 69 : RenderViewObserver(render_view), |
70 quit_closure_(quit_closure) {} | 70 quit_closure_(quit_closure) {} |
71 | 71 |
72 void DidFinishLoad(blink::WebLocalFrame* frame) override { | 72 void DidFinishLoad(blink::WebLocalFrame* frame) override { |
73 if (frame == render_view()->GetWebView()->mainFrame()) | 73 if (frame == render_view()->GetWebView()->mainFrame()) |
74 quit_closure_.Run(); | 74 quit_closure_.Run(); |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
| 78 // RenderViewObserver implementation. |
| 79 void OnDestruct() override { delete this; } |
| 80 |
78 base::Closure quit_closure_; | 81 base::Closure quit_closure_; |
79 }; | 82 }; |
80 | 83 |
81 class DomSerializerTests : public ContentBrowserTest, | 84 class DomSerializerTests : public ContentBrowserTest, |
82 public WebFrameSerializerClient { | 85 public WebFrameSerializerClient { |
83 public: | 86 public: |
84 DomSerializerTests() : serialization_reported_end_of_data_(false) {} | 87 DomSerializerTests() : serialization_reported_end_of_data_(false) {} |
85 | 88 |
86 void SetUpCommandLine(base::CommandLine* command_line) override { | 89 void SetUpCommandLine(base::CommandLine* command_line) override { |
87 command_line->AppendSwitch(switches::kSingleProcess); | 90 command_line->AppendSwitch(switches::kSingleProcess); |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 NavigateToURL(shell(), file_url); | 859 NavigateToURL(shell(), file_url); |
857 | 860 |
858 PostTaskToInProcessRendererAndWait( | 861 PostTaskToInProcessRendererAndWait( |
859 base::Bind( | 862 base::Bind( |
860 &DomSerializerTests:: | 863 &DomSerializerTests:: |
861 SubResourceForElementsInNonHTMLNamespaceOnRenderer, | 864 SubResourceForElementsInNonHTMLNamespaceOnRenderer, |
862 base::Unretained(this), file_url)); | 865 base::Unretained(this), file_url)); |
863 } | 866 } |
864 | 867 |
865 } // namespace content | 868 } // namespace content |
OLD | NEW |