OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // A simple C++ Pepper plugin for exercising deprecated PPAPI interfaces in | 5 // A simple C++ Pepper plugin for exercising deprecated PPAPI interfaces in |
6 // Blink layout tests. | 6 // Blink layout tests. |
7 // | 7 // |
8 // Most layout tests should prefer to use the normal Blink test plugin, with the | 8 // Most layout tests should prefer to use the normal Blink test plugin, with the |
9 // MIME type application/x-blink-test-plugin. For layout tests that absolutely | 9 // MIME type application/x-blink-test-plugin. For layout tests that absolutely |
10 // need to test deprecated synchronous scripting interfaces, this plugin can be | 10 // need to test deprecated synchronous scripting interfaces, this plugin can be |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 331 } |
332 | 332 |
333 // pp::Instance overrides | 333 // pp::Instance overrides |
334 bool Init(uint32_t argc, const char* argn[], const char* argv[]) override { | 334 bool Init(uint32_t argc, const char* argn[], const char* argv[]) override { |
335 for (uint32_t i = 0; i < argc; ++i) | 335 for (uint32_t i = 0; i < argc; ++i) |
336 attributes_[argn[i]] = argv[i]; | 336 attributes_[argn[i]] = argv[i]; |
337 | 337 |
338 if (HasAttribute("testwindowopen")) | 338 if (HasAttribute("testwindowopen")) |
339 return TestWindowOpen(); | 339 return TestWindowOpen(); |
340 | 340 |
| 341 if (HasAttribute("initscript")) |
| 342 ExecuteScript(attributes_["initscript"]); |
| 343 |
341 uint32_t event_classes = 0; | 344 uint32_t event_classes = 0; |
342 if (HasAttribute("keydownscript")) | 345 if (HasAttribute("keydownscript")) |
343 event_classes |= PP_INPUTEVENT_CLASS_KEYBOARD; | 346 event_classes |= PP_INPUTEVENT_CLASS_KEYBOARD; |
344 if (HasAttribute("mousedownscript")) | 347 if (HasAttribute("mousedownscript")) |
345 event_classes |= PP_INPUTEVENT_CLASS_MOUSE; | 348 event_classes |= PP_INPUTEVENT_CLASS_MOUSE; |
346 RequestFilteringInputEvents(event_classes); | 349 RequestFilteringInputEvents(event_classes); |
347 | 350 |
348 return true; | 351 return true; |
349 } | 352 } |
350 | 353 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 420 |
418 } // namespace | 421 } // namespace |
419 | 422 |
420 namespace pp { | 423 namespace pp { |
421 | 424 |
422 Module* CreateModule() { | 425 Module* CreateModule() { |
423 return new BlinkDeprecatedTestModule(); | 426 return new BlinkDeprecatedTestModule(); |
424 } | 427 } |
425 | 428 |
426 } // namespace pp | 429 } // namespace pp |
OLD | NEW |