Skip to content

Commit af8b8ee

Browse files
committed
javascript/webdriver: remove Opera support
1 parent c049af9 commit af8b8ee

File tree

6 files changed

+6
-109
lines changed

6 files changed

+6
-109
lines changed

javascript/webdriver/atoms/element.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ goog.require('webdriver.Key');
3636
*/
3737
webdriver.atoms.element.isSelected = function(element) {
3838
// Although this method looks unloved, its compiled form is used by
39-
// the Chrome and OperaDrivers.
39+
// Chrome.
4040
if (!bot.dom.isSelectable(element)) {
4141
return false;
4242
}

javascript/webdriver/browser/browser.js

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ webdriver.browser.BROWSER_NAME_ = (function() {
3030
map[goog.userAgent.IE] = webdriver.Browser.INTERNET_EXPLORER;
3131
map[goog.userAgent.product.IPAD] = webdriver.Browser.IPAD;
3232
map[goog.userAgent.product.IPHONE] = webdriver.Browser.IPHONE;
33-
map[goog.userAgent.OPERA] = webdriver.Browser.OPERA;
3433
map[goog.userAgent.product.SAFARI] = webdriver.Browser.SAFARI;
3534
return map[true] || '';
3635
})();

javascript/webdriver/capabilities.js

-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ webdriver.Browser = {
3838
INTERNET_EXPLORER: 'internet explorer',
3939
IPAD: 'iPad',
4040
IPHONE: 'iPhone',
41-
OPERA: 'opera',
4241
PHANTOM_JS: 'phantomjs',
4342
SAFARI: 'safari',
4443
HTMLUNIT: 'htmlunit'
@@ -237,15 +236,6 @@ webdriver.Capabilities.iphone = function() {
237236
};
238237

239238

240-
/**
241-
* @return {!webdriver.Capabilities} A basic set of capabilities for Opera.
242-
*/
243-
webdriver.Capabilities.opera = function() {
244-
return new webdriver.Capabilities().
245-
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.OPERA);
246-
};
247-
248-
249239
/**
250240
* @return {!webdriver.Capabilities} A basic set of capabilities for
251241
* PhantomJS.

javascript/webdriver/http/corsclient.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ goog.require('webdriver.http.Response');
4848
* This limitation appears to be intentional and is documented in WebKit's
4949
* Layout tests:
5050
* //LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects.html
51-
* <li>If the server does not return a 2xx response, IE and Opera's
52-
* implementations will fire the XDomainRequest/XMLHttpRequest object's
51+
* <li>If the server does not return a 2xx response, IE
52+
* implementation will fire the XDomainRequest/XMLHttpRequest object's
5353
* onerror handler, but without the corresponding response text returned by
54-
* the server. This renders IE and Opera incapable of handling command
54+
* the server. This renders IE incapable of handling command
5555
* failures in the standard JSON protocol.
5656
* </ul>
5757
*

javascript/webdriver/stacktrace.js

+2-47
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ webdriver.stacktrace.Snapshot = function(opt_slice) {
6060
}
6161

6262
/**
63-
* The error's stacktrace. This must be accessed immediately to ensure Opera
64-
* computes the context correctly.
63+
* The error's stacktrace.
6564
* @private {string}
6665
*/
6766
this.stack_ = webdriver.stacktrace.getStack(error);
@@ -392,40 +391,6 @@ webdriver.stacktrace.FIREFOX_STACK_FRAME_REGEXP_ = new RegExp('^' +
392391
'(?::0|' + webdriver.stacktrace.URL_PATTERN_ + ')$');
393392

394393

395-
/**
396-
* RegExp pattern for an anonymous function call in an Opera stack frame.
397-
* Creates 2 (optional) submatches: the context object and function name.
398-
* @private {string}
399-
* @const
400-
*/
401-
webdriver.stacktrace.OPERA_ANONYMOUS_FUNCTION_NAME_PATTERN_ =
402-
'<anonymous function(?:\\: ' +
403-
webdriver.stacktrace.QUALIFIED_NAME_PATTERN_ + ')?>';
404-
405-
406-
/**
407-
* RegExp pattern for a function call in an Opera stack frame.
408-
* Creates 3 (optional) submatches: the function name (if not anonymous),
409-
* the aliased context object and the function name (if anonymous).
410-
* @private {string}
411-
* @const
412-
*/
413-
webdriver.stacktrace.OPERA_FUNCTION_CALL_PATTERN_ =
414-
'(?:(?:(' + webdriver.stacktrace.IDENTIFIER_PATTERN_ + ')|' +
415-
webdriver.stacktrace.OPERA_ANONYMOUS_FUNCTION_NAME_PATTERN_ +
416-
')(?:\\(.*\\)))?@';
417-
418-
419-
/**
420-
* Regular expression for parsing on stack frame in Opera 11.68+
421-
* @private {!RegExp}
422-
* @const
423-
*/
424-
webdriver.stacktrace.OPERA_STACK_FRAME_REGEXP_ = new RegExp('^' +
425-
webdriver.stacktrace.OPERA_FUNCTION_CALL_PATTERN_ +
426-
webdriver.stacktrace.URL_PATTERN_ + '?$');
427-
428-
429394
/**
430395
* RegExp pattern for function call in a Chakra (IE) stack trace. This
431396
* expression creates 2 submatches on the (optional) context and function name,
@@ -516,11 +481,6 @@ webdriver.stacktrace.parseStackFrame_ = function(frameStr) {
516481
return new webdriver.stacktrace.Frame('', m[1], '', m[2]);
517482
}
518483

519-
m = frameStr.match(webdriver.stacktrace.OPERA_STACK_FRAME_REGEXP_);
520-
if (m) {
521-
return new webdriver.stacktrace.Frame(m[2], m[1] || m[3], '', m[4]);
522-
}
523-
524484
m = frameStr.match(webdriver.stacktrace.CHAKRA_STACK_FRAME_REGEXP_);
525485
if (m) {
526486
return new webdriver.stacktrace.Frame(m[1], m[2], '', m[3]);
@@ -641,12 +601,7 @@ webdriver.stacktrace.parse_ = function(stack) {
641601
// The first two frames will be:
642602
// webdriver.stacktrace.Snapshot()
643603
// webdriver.stacktrace.get()
644-
// In the case of Opera, sometimes an extra frame is injected in the next
645-
// frame with a reported line number of zero. The next line detects that
646-
// case and skips that frame.
647-
if (!(goog.userAgent.OPERA && i == 2 && frame.getLine() == 0)) {
648-
frames.push(frame || webdriver.stacktrace.ANONYMOUS_FRAME_);
649-
}
604+
frames.push(frame || webdriver.stacktrace.ANONYMOUS_FRAME_);
650605
}
651606
return frames;
652607
};

javascript/webdriver/test/stacktrace_test.js

-47
Original file line numberDiff line numberDiff line change
@@ -174,53 +174,6 @@ function testParseStackFrameInV8() {
174174
'/local/dir/path'));
175175
}
176176

177-
function testParseStackFrameInOpera() {
178-
assertStackFrame('empty frame', '@', webdriver.stacktrace.ANONYMOUS_FRAME_);
179-
180-
assertStackFrame('javascript path only',
181-
'@javascript:console.log(Error().stack):1',
182-
new webdriver.stacktrace.Frame('', '', '',
183-
'javascript:console.log(Error().stack):1'));
184-
185-
assertStackFrame('path only',
186-
'@file:///foo:42',
187-
new webdriver.stacktrace.Frame('', '', '', 'file:///foo:42'));
188-
189-
// (function go() { throw Error() })()
190-
// var c = go; c()
191-
assertStackFrame('name and empty path',
192-
'go([arguments not available])@',
193-
new webdriver.stacktrace.Frame('', 'go', '', ''));
194-
195-
assertStackFrame('name and path',
196-
'go([arguments not available])@file:///foo:42',
197-
new webdriver.stacktrace.Frame('', 'go', '', 'file:///foo:42'));
198-
199-
// (function() { throw Error() })()
200-
assertStackFrame('anonymous function',
201-
'<anonymous function>([arguments not available])@file:///foo:42',
202-
new webdriver.stacktrace.Frame('', '', '', 'file:///foo:42'));
203-
204-
// var b = {foo: function() { throw Error() }}
205-
assertStackFrame('object literal function',
206-
'<anonymous function: foo>()@file:///foo:42',
207-
new webdriver.stacktrace.Frame('', 'foo', '', 'file:///foo:42'));
208-
209-
// var c = {}; c.foo = function() { throw Error() }
210-
assertStackFrame('named object literal function',
211-
'<anonymous function: c.foo>()@file:///foo:42',
212-
new webdriver.stacktrace.Frame('c', 'foo', '', 'file:///foo:42'));
213-
214-
assertStackFrame('prototype function',
215-
'<anonymous function: Foo.prototype.bar>()@',
216-
new webdriver.stacktrace.Frame('Foo.prototype', 'bar', '', ''));
217-
218-
assertStackFrame('namespaced prototype function',
219-
'<anonymous function: goog.Foo.prototype.bar>()@',
220-
new webdriver.stacktrace.Frame(
221-
'goog.Foo.prototype', 'bar', '', ''));
222-
}
223-
224177
function testParseClosureCanonicalStackFrame() {
225178
assertStackFrame('unknown frame', '> (unknown)',
226179
webdriver.stacktrace.ANONYMOUS_FRAME_);

0 commit comments

Comments
 (0)