Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: content/shell/browser/webkit_test_controller.cc

Issue 790423002: Add the main frame routing ID to WebContentsDelegate, use it in BackgroundContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content shell Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shell/browser/webkit_test_controller.h" 5 #include "content/shell/browser/webkit_test_controller.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 initial_size_ = gfx::Size( 253 initial_size_ = gfx::Size(
254 Shell::kDefaultTestWindowWidthDip, Shell::kDefaultTestWindowHeightDip); 254 Shell::kDefaultTestWindowWidthDip, Shell::kDefaultTestWindowHeightDip);
255 // The W3C SVG layout tests use a different size than the other layout tests. 255 // The W3C SVG layout tests use a different size than the other layout tests.
256 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) 256 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos)
257 initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip); 257 initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip);
258 if (!main_window_) { 258 if (!main_window_) {
259 main_window_ = content::Shell::CreateNewWindow( 259 main_window_ = content::Shell::CreateNewWindow(
260 browser_context, 260 browser_context,
261 GURL(), 261 GURL(),
262 NULL, 262 NULL,
263 MSG_ROUTING_NONE,
264 initial_size_); 263 initial_size_);
265 WebContentsObserver::Observe(main_window_->web_contents()); 264 WebContentsObserver::Observe(main_window_->web_contents());
266 send_configuration_to_next_host_ = true; 265 send_configuration_to_next_host_ = true;
267 current_pid_ = base::kNullProcessId; 266 current_pid_ = base::kNullProcessId;
268 main_window_->LoadURL(test_url); 267 main_window_->LoadURL(test_url);
269 } else { 268 } else {
270 #if defined(OS_MACOSX) 269 #if defined(OS_MACOSX)
271 // Shell::SizeTo is not implemented on all platforms. 270 // Shell::SizeTo is not implemented on all platforms.
272 main_window_->SizeTo(initial_size_); 271 main_window_->SizeTo(initial_size_);
273 #endif 272 #endif
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 343 }
345 } 344 }
346 345
347 void WebKitTestController::OpenURL(const GURL& url) { 346 void WebKitTestController::OpenURL(const GURL& url) {
348 if (test_phase_ != DURING_TEST) 347 if (test_phase_ != DURING_TEST)
349 return; 348 return;
350 349
351 Shell::CreateNewWindow(main_window_->web_contents()->GetBrowserContext(), 350 Shell::CreateNewWindow(main_window_->web_contents()->GetBrowserContext(),
352 url, 351 url,
353 main_window_->web_contents()->GetSiteInstance(), 352 main_window_->web_contents()->GetSiteInstance(),
354 MSG_ROUTING_NONE,
355 gfx::Size()); 353 gfx::Size());
356 } 354 }
357 355
358 void WebKitTestController::TestFinishedInSecondaryWindow() { 356 void WebKitTestController::TestFinishedInSecondaryWindow() {
359 RenderViewHost* render_view_host = 357 RenderViewHost* render_view_host =
360 main_window_->web_contents()->GetRenderViewHost(); 358 main_window_->web_contents()->GetRenderViewHost();
361 render_view_host->Send( 359 render_view_host->Send(
362 new ShellViewMsg_NotifyDone(render_view_host->GetRoutingID())); 360 new ShellViewMsg_NotifyDone(render_view_host->GetRoutingID()));
363 } 361 }
364 362
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 682
685 printer_->AddErrorMessage( 683 printer_->AddErrorMessage(
686 base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_, 684 base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_,
687 result.detail.c_str())); 685 result.detail.c_str()));
688 CHECK(!crash_when_leak_found_); 686 CHECK(!crash_when_leak_found_);
689 687
690 DiscardMainWindow(); 688 DiscardMainWindow();
691 } 689 }
692 690
693 } // namespace content 691 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698