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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
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) && defined(USE_AURA) | 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::kDisableAcceleratedCompositing); |
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 } |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 ASSERT_TRUE(test_server()->Start()); | 355 ASSERT_TRUE(test_server()->Start()); |
356 GURL url(test_server()->GetURL("echoheader?header")); | 356 GURL url(test_server()->GetURL("echoheader?header")); |
357 | 357 |
358 PostTaskToInProcessRendererAndWait( | 358 PostTaskToInProcessRendererAndWait( |
359 base::Bind( | 359 base::Bind( |
360 &ResourceFetcherTests::ResourceFetcherSetHeader, | 360 &ResourceFetcherTests::ResourceFetcherSetHeader, |
361 base::Unretained(this), url)); | 361 base::Unretained(this), url)); |
362 } | 362 } |
363 | 363 |
364 } // namespace content | 364 } // namespace content |
OLD | NEW |