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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 return true; | 149 return true; |
150 } | 150 } |
151 | 151 |
152 class LoadObserver : public RenderViewObserver { | 152 class LoadObserver : public RenderViewObserver { |
153 public: | 153 public: |
154 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) | 154 LoadObserver(RenderView* render_view, const base::Closure& quit_closure) |
155 : RenderViewObserver(render_view), | 155 : RenderViewObserver(render_view), |
156 quit_closure_(quit_closure) {} | 156 quit_closure_(quit_closure) {} |
157 | 157 |
158 virtual void DidFinishLoad(blink::WebLocalFrame* frame) override { | 158 void DidFinishLoad(blink::WebLocalFrame* frame) override { |
159 if (frame == render_view()->GetWebView()->mainFrame()) | 159 if (frame == render_view()->GetWebView()->mainFrame()) |
160 quit_closure_.Run(); | 160 quit_closure_.Run(); |
161 } | 161 } |
162 | 162 |
163 private: | 163 private: |
164 base::Closure quit_closure_; | 164 base::Closure quit_closure_; |
165 }; | 165 }; |
166 | 166 |
167 class DomSerializerTests : public ContentBrowserTest, | 167 class DomSerializerTests : public ContentBrowserTest, |
168 public WebPageSerializerClient { | 168 public WebPageSerializerClient { |
169 public: | 169 public: |
170 DomSerializerTests() | 170 DomSerializerTests() |
171 : serialized_(false), | 171 : serialized_(false), |
172 local_directory_name_(FILE_PATH_LITERAL("./dummy_files/")) {} | 172 local_directory_name_(FILE_PATH_LITERAL("./dummy_files/")) {} |
173 | 173 |
174 virtual void SetUpCommandLine(CommandLine* command_line) override { | 174 void SetUpCommandLine(CommandLine* command_line) override { |
175 command_line->AppendSwitch(switches::kSingleProcess); | 175 command_line->AppendSwitch(switches::kSingleProcess); |
176 #if defined(OS_WIN) | 176 #if defined(OS_WIN) |
177 // Don't want to try to create a GPU process. | 177 // Don't want to try to create a GPU process. |
178 command_line->AppendSwitch(switches::kDisableGpu); | 178 command_line->AppendSwitch(switches::kDisableGpu); |
179 #endif | 179 #endif |
180 } | 180 } |
181 | 181 |
182 // DomSerializerDelegate. | 182 // DomSerializerDelegate. |
183 virtual void didSerializeDataForFrame(const WebURL& frame_web_url, | 183 virtual void didSerializeDataForFrame(const WebURL& frame_web_url, |
184 const WebCString& data, | 184 const WebCString& data, |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 NavigateToURL(shell(), file_url); | 1020 NavigateToURL(shell(), file_url); |
1021 | 1021 |
1022 PostTaskToInProcessRendererAndWait( | 1022 PostTaskToInProcessRendererAndWait( |
1023 base::Bind( | 1023 base::Bind( |
1024 &DomSerializerTests:: | 1024 &DomSerializerTests:: |
1025 SubResourceForElementsInNonHTMLNamespaceOnRenderer, | 1025 SubResourceForElementsInNonHTMLNamespaceOnRenderer, |
1026 base::Unretained(this), file_url)); | 1026 base::Unretained(this), file_url)); |
1027 } | 1027 } |
1028 | 1028 |
1029 } // namespace content | 1029 } // namespace content |
OLD | NEW |