Index: cc/test/layer_tree_json_parser.cc |
diff --git a/cc/test/layer_tree_json_parser.cc b/cc/test/layer_tree_json_parser.cc |
index 4dd3d661e13fc257178412002ea34177acd5bf35..f71ec4e21350053ad612a334d1c7313d37ca3cc4 100644 |
--- a/cc/test/layer_tree_json_parser.cc |
+++ b/cc/test/layer_tree_json_parser.cc |
@@ -20,6 +20,28 @@ namespace cc { |
namespace { |
+bool GetEventListenerProperties(base::DictionaryValue* dict, |
+ const char* property, |
+ EventListenerProperties* listener_properties) { |
+ *listener_properties = EventListenerProperties::NONE; |
+ base::ListValue* list; |
+ bool success = true; |
+ if (dict->HasKey(property)) { |
+ success &= dict->GetList(property, &list); |
+ std::string str; |
+ for (size_t i = 0; i < list->GetSize(); i++) { |
+ success &= list->GetString(i, &str); |
+ if (str == "Blocking") |
+ *listener_properties |= EventListenerProperties::BLOCKING; |
+ else if (str == "Passive") |
+ *listener_properties |= EventListenerProperties::PASSIVE; |
+ else |
+ success = false; |
+ } |
+ } |
+ return success; |
+} |
+ |
scoped_refptr<Layer> ParseTreeFromValue(base::Value* val, |
ContentLayerClient* content_client) { |
base::DictionaryValue* dict; |
@@ -125,9 +147,14 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val, |
new_layer->SetScrollClipLayerId(scrollable ? new_layer->id() |
: Layer::INVALID_ID); |
- bool wheel_handler; |
- if (dict->GetBoolean("WheelHandler", &wheel_handler)) |
- new_layer->SetHaveWheelEventHandlers(wheel_handler); |
+ EventListenerProperties listener_properties; |
+ success &= |
+ GetEventListenerProperties(dict, "TouchHandler", &listener_properties); |
+ new_layer->SetTouchEventProperties(listener_properties); |
+ |
+ success &= |
+ GetEventListenerProperties(dict, "WheelHandler", &listener_properties); |
+ new_layer->SetWheelEventProperties(listener_properties); |
bool scroll_handler; |
if (dict->GetBoolean("ScrollHandler", &scroll_handler)) |