function testNavigateForLinksWithoutScheme() {
    var url = "http://www.example.com/subdir/xyz.pdf";

    // Sanity check.
    doNavigationUrlTests(
        url,
        'https://www.foo.com/bar.pdf',
        'https://www.foo.com/bar.pdf');

    // Open relative links.
    doNavigationUrlTests(
        url,
        'foo/bar.pdf',
        'http://www.example.com/subdir/foo/bar.pdf');
    doNavigationUrlTests(
        url,
        'foo.com/bar.pdf',
        'http://www.example.com/subdir/foo.com/bar.pdf');
    // The expected result is not normalized here.
    doNavigationUrlTests(
        url,
        '../www.foo.com/bar.pdf',
        'http://www.example.com/subdir/../www.foo.com/bar.pdf');

    // Open an absolute link.
    doNavigationUrlTests(
        url,
        '/foodotcom/bar.pdf',
        'http://www.example.com/foodotcom/bar.pdf');

    // Open a http url without a scheme.
    doNavigationUrlTests(
        url,
        'www.foo.com/bar.pdf',
        'http://www.foo.com/bar.pdf');

    // Test three dots.
    doNavigationUrlTests(
        url,
        '.../bar.pdf',
        'http://www.example.com/subdir/.../bar.pdf');

    // Test forward slashes.
    doNavigationUrlTests(
        url,
        '..\\bar.pdf',
        'http://www.example.com/subdir/..\\bar.pdf');
    doNavigationUrlTests(
        url,
        '.\\bar.pdf',
        'http://www.example.com/subdir/.\\bar.pdf');
    doNavigationUrlTests(
        url,
        '\\bar.pdf',
        'http://www.example.com/subdir/\\bar.pdf');

    // Regression test for https://crbug.com/569040
    doNavigationUrlTests(
        url,
        'http://something.else/foo#page=5',
        'http://something.else/foo#page=5');

    chrome.test.succeed();
  }
/**
   * Test opening a url in the same tab, in a new tab, and in a new window for
   * a http:// url as the current location. The destination url may not have
   * a valid scheme, so the navigator must determine the url by following
   * similar heuristics as Adobe Acrobat Reader.
   */
Test opening a url in the same tab, in a new tab, and in a new window for
a http:// url as the current location. The destination url may not have
a valid scheme, so the navigator must determine the url by following
similar heuristics as Adobe Acrobat Reader.
Test opening a url in the same tab in a new tab and in a new window for a http : // url as the current location . The destination url may not have a valid scheme so the navigator must determine the url by following similar heuristics as Adobe Acrobat Reader .
function testNavigateForLinksWithoutScheme() {
    var url = "http://www.example.com/subdir/xyz.pdf";
    doNavigationUrlTests(
        url,
        'https://www.foo.com/bar.pdf',
        'https://www.foo.com/bar.pdf');
    doNavigationUrlTests(
        url,
        'foo/bar.pdf',
        'http://www.example.com/subdir/foo/bar.pdf');
    doNavigationUrlTests(
        url,
        'foo.com/bar.pdf',
        'http://www.example.com/subdir/foo.com/bar.pdf');
    doNavigationUrlTests(
        url,
        '../www.foo.com/bar.pdf',
        'http://www.example.com/subdir/../www.foo.com/bar.pdf');
    doNavigationUrlTests(
        url,
        '/foodotcom/bar.pdf',
        'http://www.example.com/foodotcom/bar.pdf');
    doNavigationUrlTests(
        url,
        'www.foo.com/bar.pdf',
        'http://www.foo.com/bar.pdf');
    doNavigationUrlTests(
        url,
        '.../bar.pdf',
        'http://www.example.com/subdir/.../bar.pdf');
    doNavigationUrlTests(
        url,
        '..\\bar.pdf',
        'http://www.example.com/subdir/..\\bar.pdf');
    doNavigationUrlTests(
        url,
        '.\\bar.pdf',
        'http://www.example.com/subdir/.\\bar.pdf');
    doNavigationUrlTests(
        url,
        '\\bar.pdf',
        'http://www.example.com/subdir/\\bar.pdf');
    doNavigationUrlTests(
        url,
        'http://something.else/foo#page=5',
        'http://something.else/foo#page=5');
    chrome.test.succeed();
  }
function testNavigateForLinksWithoutScheme ( ) { var url = "http://www.example.com/subdir/xyz.pdf" ; doNavigationUrlTests ( url , 'https://www.foo.com/bar.pdf' , 'https://www.foo.com/bar.pdf' ) ; doNavigationUrlTests ( url , 'foo/bar.pdf' , 'http://www.example.com/subdir/foo/bar.pdf' ) ; doNavigationUrlTests ( url , 'foo.com/bar.pdf' , 'http://www.example.com/subdir/foo.com/bar.pdf' ) ; doNavigationUrlTests ( url , '../www.foo.com/bar.pdf' , 'http://www.example.com/subdir/../www.foo.com/bar.pdf' ) ; doNavigationUrlTests ( url , '/foodotcom/bar.pdf' , 'http://www.example.com/foodotcom/bar.pdf' ) ; doNavigationUrlTests ( url , 'www.foo.com/bar.pdf' , 'http://www.foo.com/bar.pdf' ) ; doNavigationUrlTests ( url , '.../bar.pdf' , 'http://www.example.com/subdir/.../bar.pdf' ) ; doNavigationUrlTests ( url , '..\\bar.pdf' , 'http://www.example.com/subdir/..\\bar.pdf' ) ; doNavigationUrlTests ( url , '.\\bar.pdf' , 'http://www.example.com/subdir/.\\bar.pdf' ) ; doNavigationUrlTests ( url , '\\bar.pdf' , 'http://www.example.com/subdir/\\bar.pdf' ) ; doNavigationUrlTests ( url , 'http://something.else/foo#page=5' , 'http://something.else/foo#page=5' ) ; chrome . test . succeed ( ) ; }
Test opening a url in the same tab, in a new tab, and in a new window for
 a http:// url as the current location.
Test opening a url in the same tab in a new tab and in a new window for a http : // url as the current location .
// Sanity check. // Open relative links. // The expected result is not normalized here. // Open an absolute link. // Open a http url without a scheme. // Test three dots. // Test forward slashes. // Regression test for https://crbug.com/569040