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