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/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 return true; | 145 return true; |
146 } | 146 } |
147 | 147 |
148 class LoadObserver : public RenderViewObserver { | 148 class LoadObserver : public RenderViewObserver { |
149 public: | 149 public: |
150 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) | 150 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) |
151 : RenderViewObserver(render_view), | 151 : RenderViewObserver(render_view), |
152 quit_closure_(quit_closure) {} | 152 quit_closure_(quit_closure) {} |
153 | 153 |
154 virtual void DidFinishLoad(WebKit::WebFrame* frame) { | 154 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE { |
155 if (frame == render_view()->GetWebView()->mainFrame()) | 155 if (frame == render_view()->GetWebView()->mainFrame()) |
156 quit_closure_.Run(); | 156 quit_closure_.Run(); |
157 } | 157 } |
158 | 158 |
159 private: | 159 private: |
160 base::Closure quit_closure_; | 160 base::Closure quit_closure_; |
161 }; | 161 }; |
162 | 162 |
163 class DomSerializerTests : public ContentBrowserTest, | 163 class DomSerializerTests : public ContentBrowserTest, |
164 public WebPageSerializerClient { | 164 public WebPageSerializerClient { |
165 public: | 165 public: |
166 DomSerializerTests() | 166 DomSerializerTests() |
167 : serialized_(false), | 167 : serialized_(false), |
168 local_directory_name_(FILE_PATH_LITERAL("./dummy_files/")) {} | 168 local_directory_name_(FILE_PATH_LITERAL("./dummy_files/")) {} |
169 | 169 |
170 virtual void SetUpCommandLine(CommandLine* command_line) { | 170 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
171 command_line->AppendSwitch(switches::kSingleProcess); | 171 command_line->AppendSwitch(switches::kSingleProcess); |
172 #if defined(OS_WIN) && defined(USE_AURA) | 172 #if defined(OS_WIN) && defined(USE_AURA) |
173 // Don't want to try to create a GPU process. | 173 // Don't want to try to create a GPU process. |
174 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 174 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
175 #endif | 175 #endif |
176 } | 176 } |
177 | 177 |
178 // DomSerializerDelegate. | 178 // DomSerializerDelegate. |
179 virtual void didSerializeDataForFrame(const WebURL& frame_web_url, | 179 virtual void didSerializeDataForFrame(const WebURL& frame_web_url, |
180 const WebCString& data, | 180 const WebCString& data, |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 NavigateToURL(shell(), file_url); | 1010 NavigateToURL(shell(), file_url); |
1011 | 1011 |
1012 PostTaskToInProcessRendererAndWait( | 1012 PostTaskToInProcessRendererAndWait( |
1013 base::Bind( | 1013 base::Bind( |
1014 &DomSerializerTests:: | 1014 &DomSerializerTests:: |
1015 SubResourceForElementsInNonHTMLNamespaceOnRenderer, | 1015 SubResourceForElementsInNonHTMLNamespaceOnRenderer, |
1016 base::Unretained(this), file_url)); | 1016 base::Unretained(this), file_url)); |
1017 } | 1017 } |
1018 | 1018 |
1019 } // namespace content | 1019 } // namespace content |
OLD | NEW |