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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrameTest.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/frame/LocalFrame.h" 5 #include "core/frame/LocalFrame.h"
6 6
7 #include "core/editing/FrameSelection.h" 7 #include "core/editing/FrameSelection.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/PerformanceMonitor.h" 10 #include "core/frame/PerformanceMonitor.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 EXPECT_EQ(Color(0, 0, 255), 121 EXPECT_EQ(Color(0, 0, 255),
122 sample->layoutObject()->resolveColor(CSSPropertyColor)) 122 sample->layoutObject()->resolveColor(CSSPropertyColor))
123 << "#sample doesn't have :-webkit-drag."; 123 << "#sample doesn't have :-webkit-drag.";
124 } 124 }
125 125
126 TEST_F(LocalFrameTest, dragImageForSelectionUsesPageScaleFactor) { 126 TEST_F(LocalFrameTest, dragImageForSelectionUsesPageScaleFactor) {
127 setBodyContent( 127 setBodyContent(
128 "<div>Hello world! This tests that the bitmap for drag image is scaled " 128 "<div>Hello world! This tests that the bitmap for drag image is scaled "
129 "by page scale factor</div>"); 129 "by page scale factor</div>");
130 frame().host()->visualViewport().setScale(1); 130 frame().page()->visualViewport().setScale(1);
131 frame().selection().selectAll(); 131 frame().selection().selectAll();
132 updateAllLifecyclePhases(); 132 updateAllLifecyclePhases();
133 const std::unique_ptr<DragImage> image1(frame().dragImageForSelection(0.75f)); 133 const std::unique_ptr<DragImage> image1(frame().dragImageForSelection(0.75f));
134 frame().host()->visualViewport().setScale(2); 134 frame().page()->visualViewport().setScale(2);
135 frame().selection().selectAll(); 135 frame().selection().selectAll();
136 updateAllLifecyclePhases(); 136 updateAllLifecyclePhases();
137 const std::unique_ptr<DragImage> image2(frame().dragImageForSelection(0.75f)); 137 const std::unique_ptr<DragImage> image2(frame().dragImageForSelection(0.75f));
138 138
139 EXPECT_GT(image1->size().width(), 0); 139 EXPECT_GT(image1->size().width(), 0);
140 EXPECT_GT(image1->size().height(), 0); 140 EXPECT_GT(image1->size().height(), 0);
141 EXPECT_EQ(image1->size().width() * 2, image2->size().width()); 141 EXPECT_EQ(image1->size().width() * 2, image2->size().width());
142 EXPECT_EQ(image1->size().height() * 2, image2->size().height()); 142 EXPECT_EQ(image1->size().height() * 2, image2->size().height());
143 } 143 }
144 144
145 } // namespace blink 145 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698