From 72b7e50f9e36375987767ec34174662c5dedd218 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 17 Jul 2017 21:04:09 -0700 Subject: [PATCH] [phantom_shim] implement deprecated frame switching api --- phantom_shim/WebPage.js | 29 +++++++++++++++++++ .../webpage/frame-switching-deprecated.js | 1 - 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/phantom_shim/WebPage.js b/phantom_shim/WebPage.js index 4fcd28cf..78de0b1b 100644 --- a/phantom_shim/WebPage.js +++ b/phantom_shim/WebPage.js @@ -91,6 +91,35 @@ class WebPage { this.onConsoleMessage(text); } + /** + * @return {string} + */ + currentFrameName() { + return this.frameName; + } + + /** + * @return {number} + */ + childFramesCount() { + return this.framesCount; + } + + /** + * @return {!Array} + */ + childFramesName() { + return this.framesName; + } + + /** + * @param {(string|number)} frameName + * @return {boolean} + */ + switchToChildFrame(frame) { + return this.switchToFrame(frame); + } + /** * @return {string} */ diff --git a/third_party/phantomjs/test/module/webpage/frame-switching-deprecated.js b/third_party/phantomjs/test/module/webpage/frame-switching-deprecated.js index f20938c9..54e5b748 100644 --- a/third_party/phantomjs/test/module/webpage/frame-switching-deprecated.js +++ b/third_party/phantomjs/test/module/webpage/frame-switching-deprecated.js @@ -1,4 +1,3 @@ -//! unsupported async_test(function () { var p = require("webpage").create();