| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 TEST_F(RenderViewHostTest, RoutingIdSane) { | 237 TEST_F(RenderViewHostTest, RoutingIdSane) { |
| 238 RenderFrameHostImpl* root_rfh = | 238 RenderFrameHostImpl* root_rfh = |
| 239 contents()->GetFrameTree()->root()->current_frame_host(); | 239 contents()->GetFrameTree()->root()->current_frame_host(); |
| 240 EXPECT_EQ(contents()->GetMainFrame(), root_rfh); | 240 EXPECT_EQ(contents()->GetMainFrame(), root_rfh); |
| 241 EXPECT_EQ(test_rvh()->GetProcess(), root_rfh->GetProcess()); | 241 EXPECT_EQ(test_rvh()->GetProcess(), root_rfh->GetProcess()); |
| 242 EXPECT_NE(test_rvh()->GetRoutingID(), root_rfh->routing_id()); | 242 EXPECT_NE(test_rvh()->GetRoutingID(), root_rfh->routing_id()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 class TestSaveImageFromDataURL : public RenderMessageFilter { | 245 class TestSaveImageFromDataURL : public RenderMessageFilter { |
| 246 public: | 246 public: |
| 247 TestSaveImageFromDataURL( | 247 TestSaveImageFromDataURL(BrowserContext* context) |
| 248 BrowserContext* context) | 248 : RenderMessageFilter(0, |
| 249 : RenderMessageFilter( | 249 context, |
| 250 0, | 250 BrowserContext::GetDefaultStoragePartition(context) |
| 251 context, | 251 ->GetURLRequestContext(), |
| 252 BrowserContext::GetDefaultStoragePartition(context)-> | 252 nullptr, |
| 253 GetURLRequestContext(), | 253 nullptr, |
| 254 nullptr, | 254 nullptr, |
| 255 nullptr, | 255 nullptr, |
| 256 nullptr, | 256 nullptr) { |
| 257 nullptr) { | |
| 258 Reset(); | 257 Reset(); |
| 259 } | 258 } |
| 260 | 259 |
| 261 void Reset() { | 260 void Reset() { |
| 262 url_string_ = std::string(); | 261 url_string_ = std::string(); |
| 263 is_downloaded_ = false; | 262 is_downloaded_ = false; |
| 264 } | 263 } |
| 265 | 264 |
| 266 std::string& UrlString() const { | 265 std::string& UrlString() const { |
| 267 return url_string_; | 266 return url_string_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 const std::string data_url = "data:image/gif;base64," | 303 const std::string data_url = "data:image/gif;base64," |
| 305 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; | 304 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; |
| 306 | 305 |
| 307 tester->Reset(); | 306 tester->Reset(); |
| 308 tester->Test(data_url); | 307 tester->Test(data_url); |
| 309 EXPECT_EQ(tester->UrlString(), data_url); | 308 EXPECT_EQ(tester->UrlString(), data_url); |
| 310 EXPECT_TRUE(tester->IsDownloaded()); | 309 EXPECT_TRUE(tester->IsDownloaded()); |
| 311 } | 310 } |
| 312 | 311 |
| 313 } // namespace content | 312 } // namespace content |
| OLD | NEW |