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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "bindings/core/v8/ScriptController.h" 5 #include "bindings/core/v8/ScriptController.h"
6 #include "bindings/core/v8/ScriptSourceCode.h" 6 #include "bindings/core/v8/ScriptSourceCode.h"
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 24 matching lines...) Expand all
35 using namespace HTMLNames; 35 using namespace HTMLNames;
36 36
37 // NOTE: This test uses <iframe sandbox> to create cross origin iframes. 37 // NOTE: This test uses <iframe sandbox> to create cross origin iframes.
38 38
39 namespace { 39 namespace {
40 40
41 class MockWebDisplayItemList : public WebDisplayItemList { 41 class MockWebDisplayItemList : public WebDisplayItemList {
42 public: 42 public:
43 ~MockWebDisplayItemList() override {} 43 ~MockWebDisplayItemList() override {}
44 44
45 MOCK_METHOD2(appendDrawingItem, void(const WebRect&, sk_sp<const SkPicture>)); 45 MOCK_METHOD2(appendDrawingItem,
46 void(const WebRect&, sk_sp<const CdlPicture>));
46 }; 47 };
47 48
48 void paintRecursively(GraphicsLayer* layer, WebDisplayItemList* displayItems) { 49 void paintRecursively(GraphicsLayer* layer, WebDisplayItemList* displayItems) {
49 if (layer->drawsContent()) { 50 if (layer->drawsContent()) {
50 layer->setNeedsDisplay(); 51 layer->setNeedsDisplay();
51 layer->contentLayerDelegateForTesting()->paintContents( 52 layer->contentLayerDelegateForTesting()->paintContents(
52 displayItems, ContentLayerDelegate::PaintDefaultBehaviorForTest); 53 displayItems, ContentLayerDelegate::PaintDefaultBehaviorForTest);
53 } 54 }
54 for (const auto& child : layer->children()) 55 for (const auto& child : layer->children())
55 paintRecursively(child, displayItems); 56 paintRecursively(child, displayItems);
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 923
923 LocalFrame* localFrame = toLocalFrame(frameElement->contentFrame()); 924 LocalFrame* localFrame = toLocalFrame(frameElement->contentFrame());
924 v8::HandleScope scope(v8::Isolate::GetCurrent()); 925 v8::HandleScope scope(v8::Isolate::GetCurrent());
925 v8::Local<v8::Value> result = 926 v8::Local<v8::Value> result =
926 localFrame->script().executeScriptInMainWorldAndReturnValue( 927 localFrame->script().executeScriptInMainWorldAndReturnValue(
927 ScriptSourceCode("window.didRaf;")); 928 ScriptSourceCode("window.didRaf;"));
928 EXPECT_TRUE(result->IsTrue()); 929 EXPECT_TRUE(result->IsTrue());
929 } 930 }
930 931
931 } // namespace blink 932 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698