| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014, Google Inc. All rights reserved. | 2 * Copyright (c) 2014, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/css/CSSTestHelper.h" | 30 #include "core/css/CSSTestHelper.h" |
| 31 | 31 |
| 32 #include "core/css/CSSRuleList.h" | 32 #include "core/css/CSSRuleList.h" |
| 33 #include "core/css/CSSStyleSheet.h" | 33 #include "core/css/CSSStyleSheet.h" |
| 34 #include "core/css/RuleSet.h" | 34 #include "core/css/RuleSet.h" |
| 35 #include "core/css/StyleSheetContents.h" | 35 #include "core/css/StyleSheetContents.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "platform/wtf/text/WTFString.h" |
| 37 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 38 #include "wtf/text/WTFString.h" | |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 CSSTestHelper::~CSSTestHelper() {} | 42 CSSTestHelper::~CSSTestHelper() {} |
| 43 | 43 |
| 44 CSSTestHelper::CSSTestHelper() { | 44 CSSTestHelper::CSSTestHelper() { |
| 45 document_ = Document::Create(); | 45 document_ = Document::Create(); |
| 46 TextPosition position; | 46 TextPosition position; |
| 47 style_sheet_ = | 47 style_sheet_ = |
| 48 CSSStyleSheet::CreateInline(*document_, KURL(), position, "UTF-8"); | 48 CSSStyleSheet::CreateInline(*document_, KURL(), position, "UTF-8"); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CSSTestHelper::AddCSSRules(const char* css_text) { | 62 void CSSTestHelper::AddCSSRules(const char* css_text) { |
| 63 TextPosition position; | 63 TextPosition position; |
| 64 unsigned sheet_length = style_sheet_->length(); | 64 unsigned sheet_length = style_sheet_->length(); |
| 65 style_sheet_->Contents()->ParseStringAtPosition(css_text, position); | 65 style_sheet_->Contents()->ParseStringAtPosition(css_text, position); |
| 66 ASSERT_TRUE(style_sheet_->length() > sheet_length); | 66 ASSERT_TRUE(style_sheet_->length() > sheet_length); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |