Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |