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
3 // found in the LICENSE file.
5 var iframe_hosts = ['http://127.0.0.1', 'http://localhost'];
6 function getIFrameSrc(iframe_id) {
7 var port = location.port;
8 var path = location.pathname.substring(0, location.pathname.lastIndexOf('/'));
9 var url = iframe_hosts[iframe_id] + ':' + port + path + '/simple.html';
12 function addIFrame(iframe_id, iframe_src) {
13 var id = 'iframe_' + iframe_id;
14 var iframe = document.getElementById(id);
16 iframe.src = iframe_src;
18 iframe.src = getIFrameSrc(iframe_id);
20 return "" + iframe_id;