| 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 "webkit/glue/resource_fetcher.h" | 5 #include "webkit/glue/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.h" | 10 #include "base/message_loop.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 fetcher_.reset(); | 114 fetcher_.reset(); |
| 115 FetcherDelegate::OnURLFetchComplete(response, data); | 115 FetcherDelegate::OnURLFetchComplete(response, data); |
| 116 } | 116 } |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 scoped_ptr<ResourceFetcher> fetcher_; | 119 scoped_ptr<ResourceFetcher> fetcher_; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 class ResourceFetcherTests : public ContentBrowserTest { | 122 class ResourceFetcherTests : public ContentBrowserTest { |
| 123 public: | 123 public: |
| 124 virtual void SetUpCommandLine(CommandLine* command_line) { | 124 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 125 command_line->AppendSwitch(switches::kSingleProcess); | 125 command_line->AppendSwitch(switches::kSingleProcess); |
| 126 #if defined(OS_WIN) && defined(USE_AURA) | 126 #if defined(OS_WIN) && defined(USE_AURA) |
| 127 // Don't want to try to create a GPU process. | 127 // Don't want to try to create a GPU process. |
| 128 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 128 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
| 129 #endif | 129 #endif |
| 130 } | 130 } |
| 131 | 131 |
| 132 RenderView* GetRenderView() { | 132 RenderView* GetRenderView() { |
| 133 // We could have the test on the UI thread get the WebContent's routing ID, | 133 // We could have the test on the UI thread get the WebContent's routing ID, |
| 134 // but we know this will be the first RV so skip that and just hardcode it. | 134 // but we know this will be the first RV so skip that and just hardcode it. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 ASSERT_TRUE(test_server()->Start()); | 275 ASSERT_TRUE(test_server()->Start()); |
| 276 GURL url(test_server()->GetURL("slow?1")); | 276 GURL url(test_server()->GetURL("slow?1")); |
| 277 | 277 |
| 278 PostTaskToInProcessRendererAndWait( | 278 PostTaskToInProcessRendererAndWait( |
| 279 base::Bind( | 279 base::Bind( |
| 280 &ResourceFetcherTests::ResourceFetcherDeletedInCallbackOnRenderer, | 280 &ResourceFetcherTests::ResourceFetcherDeletedInCallbackOnRenderer, |
| 281 base::Unretained(this), url)); | 281 base::Unretained(this), url)); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace content | 284 } // namespace content |
| OLD | NEW |