| OLD | NEW | 
|   1 // Copyright 2014 The Chromium Authors. All rights reserved. |   1 // Copyright 2014 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 "config.h" |   5 #include "config.h" | 
|   6 #include "core/css/parser/SizesAttributeParser.h" |   6 #include "core/css/parser/SizesAttributeParser.h" | 
|   7  |   7  | 
|   8 #include "core/css/MediaValuesCached.h" |   8 #include "core/css/MediaValuesCached.h" | 
|   9  |   9  | 
|  10 #include <gtest/gtest.h> |  10 #include <gtest/gtest.h> | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  53     MediaValuesCached::MediaValuesCachedData data; |  53     MediaValuesCached::MediaValuesCachedData data; | 
|  54     data.viewportWidth = 500; |  54     data.viewportWidth = 500; | 
|  55     data.viewportHeight = 500; |  55     data.viewportHeight = 500; | 
|  56     data.deviceWidth = 500; |  56     data.deviceWidth = 500; | 
|  57     data.deviceHeight = 500; |  57     data.deviceHeight = 500; | 
|  58     data.devicePixelRatio = 2.0; |  58     data.devicePixelRatio = 2.0; | 
|  59     data.colorBitsPerComponent = 24; |  59     data.colorBitsPerComponent = 24; | 
|  60     data.monochromeBitsPerComponent = 0; |  60     data.monochromeBitsPerComponent = 0; | 
|  61     data.pointer = MediaValues::MousePointer; |  61     data.pointer = MediaValues::MousePointer; | 
|  62     data.defaultFontSize = 16; |  62     data.defaultFontSize = 16; | 
|  63     data.computedFontSize = 16; |  | 
|  64     data.threeDEnabled = true; |  63     data.threeDEnabled = true; | 
|  65     data.scanMediaType = false; |  64     data.scanMediaType = false; | 
|  66     data.screenMediaType = true; |  65     data.screenMediaType = true; | 
|  67     data.printMediaType = false; |  66     data.printMediaType = false; | 
|  68     data.strictMode = true; |  67     data.strictMode = true; | 
|  69     RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data); |  68     RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data); | 
|  70  |  69  | 
|  71     for (unsigned i = 0; testCases[i].input; ++i) { |  70     for (unsigned i = 0; testCases[i].input; ++i) { | 
|  72         int effectiveSize = SizesAttributeParser::findEffectiveSize(testCases[i]
    .input, mediaValues); |  71         int effectiveSize = SizesAttributeParser::findEffectiveSize(testCases[i]
    .input, mediaValues); | 
|  73         ASSERT_EQ(testCases[i].output, effectiveSize); |  72         ASSERT_EQ(testCases[i].output, effectiveSize); | 
|  74     } |  73     } | 
|  75 } |  74 } | 
|  76  |  75  | 
|  77 } // namespace |  76 } // namespace | 
| OLD | NEW |