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

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

Issue 1467123003: Create base class for common functionality of Web{Local,Remote}Frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 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 /* 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 22 matching lines...) Expand all
33 33
34 #include "platform/testing/URLTestHelpers.h" 34 #include "platform/testing/URLTestHelpers.h"
35 #include "platform/testing/UnitTestHelpers.h" 35 #include "platform/testing/UnitTestHelpers.h"
36 #include "public/platform/Platform.h" 36 #include "public/platform/Platform.h"
37 #include "public/platform/WebData.h" 37 #include "public/platform/WebData.h"
38 #include "public/platform/WebString.h" 38 #include "public/platform/WebString.h"
39 #include "public/platform/WebThread.h" 39 #include "public/platform/WebThread.h"
40 #include "public/platform/WebURLRequest.h" 40 #include "public/platform/WebURLRequest.h"
41 #include "public/platform/WebURLResponse.h" 41 #include "public/platform/WebURLResponse.h"
42 #include "public/platform/WebUnitTestSupport.h" 42 #include "public/platform/WebUnitTestSupport.h"
43 #include "public/web/WebRemoteFrame.h"
44 #include "public/web/WebSettings.h" 43 #include "public/web/WebSettings.h"
45 #include "public/web/WebTreeScopeType.h" 44 #include "public/web/WebTreeScopeType.h"
46 #include "public/web/WebViewClient.h" 45 #include "public/web/WebViewClient.h"
47 #include "web/WebLocalFrameImpl.h" 46 #include "web/WebLocalFrameImpl.h"
47 #include "web/WebRemoteFrameImpl.h"
48 #include "wtf/StdLibExtras.h" 48 #include "wtf/StdLibExtras.h"
49 49
50 namespace blink { 50 namespace blink {
51 namespace FrameTestHelpers { 51 namespace FrameTestHelpers {
52 52
53 namespace { 53 namespace {
54 54
55 // The frame test helpers coordinate frame loads in a carefully choreographed 55 // The frame test helpers coordinate frame loads in a carefully choreographed
56 // dance. Since the parser is threaded, simply spinning the run loop once is not 56 // dance. Since the parser is threaded, simply spinning the run loop once is not
57 // enough to ensure completion of a load. Instead, the following pattern is 57 // enough to ensure completion of a load. Instead, the following pattern is
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // and asynchronous parsing make use of off main thread HTML parser. 326 // and asynchronous parsing make use of off main thread HTML parser.
327 testing::runPendingTasks(); 327 testing::runPendingTasks();
328 if (!isLoading()) 328 if (!isLoading())
329 break; 329 break;
330 330
331 Platform::current()->yieldCurrentThread(); 331 Platform::current()->yieldCurrentThread();
332 } 332 }
333 } 333 }
334 334
335 TestWebRemoteFrameClient::TestWebRemoteFrameClient() 335 TestWebRemoteFrameClient::TestWebRemoteFrameClient()
336 : m_frame(WebRemoteFrame::create(WebTreeScopeType::Document, this)) 336 : m_frame(WebRemoteFrameImpl::create(WebTreeScopeType::Document, this))
337 { 337 {
338 } 338 }
339 339
340 void TestWebRemoteFrameClient::frameDetached(DetachType type) 340 void TestWebRemoteFrameClient::frameDetached(DetachType type)
341 { 341 {
342 if (type == DetachType::Remove && m_frame->parent()) 342 if (type == DetachType::Remove && m_frame->parent())
343 m_frame->parent()->removeChild(m_frame); 343 m_frame->parent()->removeChild(m_frame);
344 m_frame->close(); 344 m_frame->close();
345 } 345 }
346 346
347 void TestWebViewClient::initializeLayerTreeView() 347 void TestWebViewClient::initializeLayerTreeView()
348 { 348 {
349 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay erTreeViewForTesting()); 349 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay erTreeViewForTesting());
350 ASSERT(m_layerTreeView); 350 ASSERT(m_layerTreeView);
351 } 351 }
352 352
353 } // namespace FrameTestHelpers 353 } // namespace FrameTestHelpers
354 } // namespace blink 354 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameTestHelpers.h ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698