Chromium Code Reviews| Index: LayoutTests/http/tests/resources/testharness.js |
| diff --git a/LayoutTests/http/tests/resources/testharness.js b/LayoutTests/http/tests/resources/testharness.js |
| index 2b3eaaa3ec7ac1b7f83c21cdb170515f0c80ef7c..732e9a167ce844928e2edf8a17d27e58cc53959d 100644 |
| --- a/LayoutTests/http/tests/resources/testharness.js |
| +++ b/LayoutTests/http/tests/resources/testharness.js |
| @@ -390,6 +390,13 @@ policies and contribution forms [3]. |
| * assert that an object that is an instance of some interface has the |
| * attribute attribute_name following the conditions specified by WebIDL |
| * |
| + * assert_will_be_idl_attribute(object, attribute_name, description) |
|
jsbell
2015/01/21 18:09:39
I know it's temporary, but we should avoid making
Yuki
2015/01/22 06:53:29
Done.
|
| + * assert that an object that is an instance of some interface has the |
| + * attribute attribute_name following the conditions specified by WebIDL, |
| + * but it's acceptable that the attribute attribute_name is an own property |
| + * of the object because we're in the middle of moving the attribute to |
| + * a prototype chain. |
| + * |
| * assert_readonly(object, property_name, description) |
| * assert that property property_name on object is readonly |
| * |
| @@ -1351,6 +1358,28 @@ policies and contribution forms [3]. |
| expose(_assert_inherits("assert_inherits"), "assert_inherits"); |
| expose(_assert_inherits("assert_idl_attribute"), "assert_idl_attribute"); |
| + // FIXME: Remove assert_will_be_idl_attribute once we finish the transition |
| + // of moving the DOM attributes to prototype chains. |
| + function assert_will_be_idl_attribute(object, property_name, description) { |
| + assert(typeof object === "object", |
| + "assert_will_be_idl_attribute", description, |
| + "provided value is not an object"); |
| + |
| + assert("hasOwnProperty" in object, |
| + "assert_will_be_idl_attribute", description, |
| + "provided value is an object but has no hasOwnProperty method"); |
| + |
| + // Do not test if property_name is not an own property because |
| + // property_name is in the middle of the transition to a prototype |
| + // chain. |
| + |
| + assert(property_name in object, |
| + "assert_will_be_idl_attribute", description, |
| + "property ${p} not found in the provided value", |
| + {p:property_name}); |
| + } |
| + expose(assert_will_be_idl_attribute, "assert_will_be_idl_attribute"); |
| + |
| function assert_readonly(object, property_name, description) |
| { |
| var initial_value = object[property_name]; |