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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLImageElementTest.cpp

Issue 2700123003: DO NOT COMMIT: Results of running old (current) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 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 "core/html/HTMLImageElement.h" 5 #include "core/html/HTMLImageElement.h"
6 6
7 #include <memory>
7 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
8 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
9 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 #include <memory>
12 12
13 namespace blink { 13 namespace blink {
14 14
15 const int viewportWidth = 500; 15 const int viewportWidth = 500;
16 const int viewportHeight = 600; 16 const int viewportHeight = 600;
17 class HTMLImageElementTest : public testing::Test { 17 class HTMLImageElementTest : public testing::Test {
18 protected: 18 protected:
19 HTMLImageElementTest() 19 HTMLImageElementTest()
20 : m_dummyPageHolder( 20 : m_dummyPageHolder(
21 DummyPageHolder::create(IntSize(viewportWidth, viewportHeight))) {} 21 DummyPageHolder::create(IntSize(viewportWidth, viewportHeight))) {}
(...skipping 15 matching lines...) Expand all
37 TEST_F(HTMLImageElementTest, sourceSize) { 37 TEST_F(HTMLImageElementTest, sourceSize) {
38 HTMLImageElement* image = HTMLImageElement::create( 38 HTMLImageElement* image = HTMLImageElement::create(
39 m_dummyPageHolder->document(), /* createdByParser */ false); 39 m_dummyPageHolder->document(), /* createdByParser */ false);
40 image->setAttribute(HTMLNames::widthAttr, "400"); 40 image->setAttribute(HTMLNames::widthAttr, "400");
41 EXPECT_EQ(viewportWidth, image->sourceSize(*image)); 41 EXPECT_EQ(viewportWidth, image->sourceSize(*image));
42 image->setAttribute(HTMLNames::sizesAttr, "50vw"); 42 image->setAttribute(HTMLNames::sizesAttr, "50vw");
43 EXPECT_EQ(250, image->sourceSize(*image)); 43 EXPECT_EQ(250, image->sourceSize(*image));
44 } 44 }
45 45
46 } // namespace blink 46 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.h ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698