| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/renderer/resource_fetcher.h" | 5 #include "content/public/renderer/resource_fetcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 private: | 128 private: |
| 129 scoped_ptr<ResourceFetcher> fetcher_; | 129 scoped_ptr<ResourceFetcher> fetcher_; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 class ResourceFetcherTests : public ContentBrowserTest { | 132 class ResourceFetcherTests : public ContentBrowserTest { |
| 133 public: | 133 public: |
| 134 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 134 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 135 command_line->AppendSwitch(switches::kSingleProcess); | 135 command_line->AppendSwitch(switches::kSingleProcess); |
| 136 #if defined(OS_WIN) | 136 #if defined(OS_WIN) |
| 137 // Don't want to try to create a GPU process. | 137 // Don't want to try to create a GPU process. |
| 138 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 138 command_line->AppendSwitch(switches::kDisableGpu); |
| 139 #endif | 139 #endif |
| 140 } | 140 } |
| 141 | 141 |
| 142 RenderView* GetRenderView() { | 142 RenderView* GetRenderView() { |
| 143 // We could have the test on the UI thread get the WebContent's routing ID, | 143 // We could have the test on the UI thread get the WebContent's routing ID, |
| 144 // but we know this will be the first RV so skip that and just hardcode it. | 144 // but we know this will be the first RV so skip that and just hardcode it. |
| 145 return RenderView::FromRoutingID(kRenderViewRoutingId); | 145 return RenderView::FromRoutingID(kRenderViewRoutingId); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void ResourceFetcherDownloadOnRenderer(const GURL& url) { | 148 void ResourceFetcherDownloadOnRenderer(const GURL& url) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 ASSERT_TRUE(test_server()->Start()); | 377 ASSERT_TRUE(test_server()->Start()); |
| 378 GURL url(test_server()->GetURL("echoheader?header")); | 378 GURL url(test_server()->GetURL("echoheader?header")); |
| 379 | 379 |
| 380 PostTaskToInProcessRendererAndWait( | 380 PostTaskToInProcessRendererAndWait( |
| 381 base::Bind( | 381 base::Bind( |
| 382 &ResourceFetcherTests::ResourceFetcherSetHeader, | 382 &ResourceFetcherTests::ResourceFetcherSetHeader, |
| 383 base::Unretained(this), url)); | 383 base::Unretained(this), url)); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace content | 386 } // namespace content |
| OLD | NEW |