| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Browser tests targeted at the RenderView that run in browser context. | 5 // Browser tests targeted at the RenderView that run in browser context. |
| 6 // Note that these tests rely on single-process mode, and hence may be | 6 // Note that these tests rely on single-process mode, and hence may be |
| 7 // disabled in some configurations (check gyp files). | 7 // disabled in some configurations (check gyp files). |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 backend_callback.Run(net::OK); | 130 backend_callback.Run(net::OK); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace | 134 } // namespace |
| 135 | 135 |
| 136 class RenderViewBrowserTest : public ContentBrowserTest { | 136 class RenderViewBrowserTest : public ContentBrowserTest { |
| 137 public: | 137 public: |
| 138 RenderViewBrowserTest() {} | 138 RenderViewBrowserTest() {} |
| 139 | 139 |
| 140 void SetUpCommandLine(CommandLine* command_line) override { | 140 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 141 // This method is needed to allow interaction with in-process renderer | 141 // This method is needed to allow interaction with in-process renderer |
| 142 // and use of a test ContentRendererClient. | 142 // and use of a test ContentRendererClient. |
| 143 command_line->AppendSwitch(switches::kSingleProcess); | 143 command_line->AppendSwitch(switches::kSingleProcess); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void SetUpOnMainThread() override { | 146 void SetUpOnMainThread() override { |
| 147 // Override setting of renderer client. | 147 // Override setting of renderer client. |
| 148 renderer_client_ = new TestShellContentRendererClient(); | 148 renderer_client_ = new TestShellContentRendererClient(); |
| 149 // Explicitly leaks ownership; this object will remain alive | 149 // Explicitly leaks ownership; this object will remain alive |
| 150 // until process death. We don't deleted the returned value, | 150 // until process death. We don't deleted the returned value, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 error_code = net::OK; | 235 error_code = net::OK; |
| 236 stale_cache_entry_present = true; | 236 stale_cache_entry_present = true; |
| 237 ASSERT_TRUE(GetLatestErrorFromRendererClient( | 237 ASSERT_TRUE(GetLatestErrorFromRendererClient( |
| 238 &error_code, &stale_cache_entry_present)); | 238 &error_code, &stale_cache_entry_present)); |
| 239 EXPECT_EQ(net::ERR_FAILED, error_code); | 239 EXPECT_EQ(net::ERR_FAILED, error_code); |
| 240 EXPECT_FALSE(stale_cache_entry_present); | 240 EXPECT_FALSE(stale_cache_entry_present); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace content | 243 } // namespace content |
| OLD | NEW |