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

Side by Side Diff: Source/web/tests/FrameTestHelpers.cpp

Issue 1041473002: Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tests and cleanup Created 5 years, 6 months 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 { 285 {
286 } 286 }
287 287
288 WebFrame* TestWebFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeSco peType scope, const WebString& frameName, WebSandboxFlags sandboxFlags) 288 WebFrame* TestWebFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeSco peType scope, const WebString& frameName, WebSandboxFlags sandboxFlags)
289 { 289 {
290 WebFrame* frame = WebLocalFrame::create(scope, this); 290 WebFrame* frame = WebLocalFrame::create(scope, this);
291 parent->appendChild(frame); 291 parent->appendChild(frame);
292 return frame; 292 return frame;
293 } 293 }
294 294
295 void TestWebFrameClient::frameDetached(WebFrame* frame) 295 void TestWebFrameClient::frameDetached(WebFrame* frame, DetachType type)
296 { 296 {
297 if (frame->parent()) 297 if (type == DetachType::Remove && frame->parent())
298 frame->parent()->removeChild(frame); 298 frame->parent()->removeChild(frame);
299 frame->close(); 299 frame->close();
300 } 300 }
301 301
302 void TestWebFrameClient::didStartLoading(bool) 302 void TestWebFrameClient::didStartLoading(bool)
303 { 303 {
304 ++m_loadsInProgress; 304 ++m_loadsInProgress;
305 } 305 }
306 306
307 void TestWebFrameClient::didStopLoading() 307 void TestWebFrameClient::didStopLoading()
(...skipping 15 matching lines...) Expand all
323 323
324 Platform::current()->yieldCurrentThread(); 324 Platform::current()->yieldCurrentThread();
325 } 325 }
326 } 326 }
327 327
328 TestWebRemoteFrameClient::TestWebRemoteFrameClient() 328 TestWebRemoteFrameClient::TestWebRemoteFrameClient()
329 : m_frame(WebRemoteFrame::create(WebTreeScopeType::Document, this)) 329 : m_frame(WebRemoteFrame::create(WebTreeScopeType::Document, this))
330 { 330 {
331 } 331 }
332 332
333 void TestWebRemoteFrameClient::frameDetached() 333 void TestWebRemoteFrameClient::frameDetached(DetachType type)
334 { 334 {
335 if (m_frame->parent()) 335 if (type == DetachType::Remove && m_frame->parent())
336 m_frame->parent()->removeChild(m_frame); 336 m_frame->parent()->removeChild(m_frame);
337 m_frame->close(); 337 m_frame->close();
338 } 338 }
339 339
340 void TestWebViewClient::initializeLayerTreeView() 340 void TestWebViewClient::initializeLayerTreeView()
341 { 341 {
342 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay erTreeViewForTesting()); 342 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay erTreeViewForTesting());
343 ASSERT(m_layerTreeView); 343 ASSERT(m_layerTreeView);
344 } 344 }
345 345
346 } // namespace FrameTestHelpers 346 } // namespace FrameTestHelpers
347 } // namespace blink 347 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698