Skip to content

Commit

Permalink
Firefox: fixing malformed URL handling. Fixed issue SeleniumHQ#1248
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Jan 25, 2016
1 parent 72fa247 commit 10443fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions java/client/test/org/openqa/selenium/PageLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ public void testShouldThrowIfUrlIsMalformed() {
driver.get("www.test.com");
}

@Ignore(value = {IE, SAFARI, PHANTOMJS})
@Test(expected = WebDriverException.class)
@NeedsFreshDriver
public void testShouldThrowIfUrlIsMalformedInPortPart() {
assumeFalse("Fails in Sauce Cloud", SauceDriver.shouldUseSauce());
driver.get("http://localhost:3001bla");
}

@Ignore(value = {SAFARI, MARIONETTE}, issues = {4062})
@Test
public void testShouldReturnWhenGettingAUrlThatDoesNotConnect() {
Expand Down
4 changes: 3 additions & 1 deletion javascript/firefox-driver/js/firefoxDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ FirefoxDriver.prototype.get = function(respond, parameters) {
try {
loadEventExpected = fxdriver.io.isLoadExpected(current, url);
} catch (e) {
var converted = e.QueryInterface(Components.interfaces['nsIException']);
goog.log.warning(FirefoxDriver.LOG_, e);
var converted = e.QueryInterface ?
e.QueryInterface(Components.interfaces['nsIException']) : e;
if ('NS_ERROR_MALFORMED_URI' == converted.name) {
goog.log.warning(FirefoxDriver.LOG_, converted.name);
respond.sendError(new WebDriverError(
Expand Down

0 comments on commit 10443fc

Please sign in to comment.