OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function waitForElements(selector, populateFunctionName, callback) { | 5 function waitForElements(selector, populateFunctionName, callback) { |
6 var elements = document.querySelectorAll(selector); | 6 var elements = document.querySelectorAll(selector); |
7 if (elements.length) { | 7 if (elements.length) { |
8 callback(elements); | 8 callback(elements); |
9 return; | 9 return; |
10 } | 10 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 var chromeBrowser = findByContentSubstring( | 60 var chromeBrowser = findByContentSubstring( |
61 browsers, 'Chrome (32.0.1679.0)', '.browser-name'); | 61 browsers, 'Chrome (32.0.1679.0)', '.browser-name'); |
62 expectNotEquals(undefined, chromeBrowser); | 62 expectNotEquals(undefined, chromeBrowser); |
63 | 63 |
64 var chromePages = chromeBrowser.querySelectorAll('.pages'); | 64 var chromePages = chromeBrowser.querySelectorAll('.pages'); |
65 var chromiumPage = findByContentSubstring( | 65 var chromiumPage = findByContentSubstring( |
66 chromePages, 'http://www.chromium.org/', '.url'); | 66 chromePages, 'http://www.chromium.org/', '.url'); |
67 expectNotEquals(undefined, chromiumPage); | 67 expectNotEquals(undefined, chromiumPage); |
68 | 68 |
| 69 var pageById = {}; |
| 70 Array.prototype.forEach.call(devices, function (device) { |
| 71 var pages = device.querySelectorAll('.row'); |
| 72 Array.prototype.forEach.call(pages, function (page) { |
| 73 expectEquals(undefined, pageById[page.targetId]); |
| 74 pageById[page.targetId] = page; |
| 75 }); |
| 76 }); |
| 77 |
69 var webView = findByContentSubstring( | 78 var webView = findByContentSubstring( |
70 browsers, 'WebView in com.sample.feed (4.0)', '.browser-name'); | 79 browsers, 'WebView in com.sample.feed (4.0)', '.browser-name'); |
71 expectNotEquals(undefined, webView); | 80 expectNotEquals(undefined, webView); |
72 | 81 |
73 testDone(); | 82 testDone(); |
74 }); | 83 }); |
75 } | 84 } |
OLD | NEW |