OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/css/cssom/CSSResourceValue.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 namespace { |
| 12 |
| 13 class FakeCSSResourceValue : public CSSResourceValue { |
| 14 public: |
| 15 FakeCSSResourceValue(Resource::Status status) |
| 16 : m_status(status) |
| 17 { |
| 18 } |
| 19 |
| 20 CSSValue* toCSSValue() const override { return nullptr; } |
| 21 |
| 22 Resource::Status status() const override { return m_status; } |
| 23 |
| 24 private: |
| 25 Resource::Status m_status; |
| 26 }; |
| 27 |
| 28 |
| 29 TEST(CSSResourceValueTest, TestStatus) |
| 30 { |
| 31 EXPECT_EQ((new FakeCSSResourceValue(Resource::NotStarted))->state(), "unload
ed"); |
| 32 EXPECT_EQ((new FakeCSSResourceValue(Resource::Pending))->state(), "loading")
; |
| 33 EXPECT_EQ((new FakeCSSResourceValue(Resource::Cached))->state(), "loaded"); |
| 34 EXPECT_EQ((new FakeCSSResourceValue(Resource::LoadError))->state(), "error")
; |
| 35 EXPECT_EQ((new FakeCSSResourceValue(Resource::DecodeError))->state(), "error
"); |
| 36 } |
| 37 |
| 38 } // namespace |
| 39 |
| 40 } // namespace blink |
OLD | NEW |