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/core/html/ImageDocumentTest.cpp

Issue 2646663002: [Blink] Don't center images in Android WebViews (Closed)
Patch Set: [Blink] Don't center images in Android WebViews Created 3 years, 11 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/html/ImageDocument.h" 5 #include "core/html/ImageDocument.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/DocumentParser.h" 8 #include "core/dom/DocumentParser.h"
9 #include "core/loader/EmptyClients.h" 9 #include "core/loader/EmptyClients.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 TEST_F(ImageDocumentTest, ImageScalesDownWithDsf) { 177 TEST_F(ImageDocumentTest, ImageScalesDownWithDsf) {
178 createDocumentWithoutLoadingImage(20, 30); 178 createDocumentWithoutLoadingImage(20, 30);
179 setWindowToViewportScalingFactor(2.f); 179 setWindowToViewportScalingFactor(2.f);
180 loadImage(); 180 loadImage();
181 EXPECT_EQ(10, imageWidth()); 181 EXPECT_EQ(10, imageWidth());
182 EXPECT_EQ(10, imageHeight()); 182 EXPECT_EQ(10, imageHeight());
183 } 183 }
184 184
185 TEST_F(ImageDocumentTest, ImagePositionedCorrectly) {
186 createDocument(80, 70);
187
188 if (document().shouldShrinkToFit()) {
aelias_OOO_until_Jul13 2017/01/19 04:08:22 This test can never go red, even without your chan
gone 2017/01/19 18:56:29 Yeah, I was conking out last night before I could
189 EXPECT_EQ(15, document().imageElement()->offsetLeft());
190 EXPECT_EQ(10, document().imageElement()->offsetTop());
191 } else {
192 EXPECT_EQ(0, document().imageElement()->offsetLeft());
193 EXPECT_EQ(0, document().imageElement()->offsetTop());
194 }
195 }
196
185 } // namespace blink 197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698