Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5115)

Unified Diff: chrome/test/data/webui/local_discovery_ui_test.js

Issue 20070002: Demo UI for device discovery and registration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/local_discovery_ui_test.js
diff --git a/chrome/test/data/webui/local_discovery_ui_test.js b/chrome/test/data/webui/local_discovery_ui_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..ef08d964c4fe1194dd52df4976e14a4e666126fd
--- /dev/null
+++ b/chrome/test/data/webui/local_discovery_ui_test.js
@@ -0,0 +1,24 @@
+var $ = document.getElementById.bind(document);
Dan Beam 2013/08/13 00:30:43 needs copyright
Dan Beam 2013/08/13 00:30:43 nit: what you have now is more generic but you see
Noam Samuel 2013/08/13 18:45:38 Done.
+
+function checkTableHasOneRow() {
+ var rows = $('devices-table').querySelectorAll('tr');
+ assertEquals(2, rows.length);
+ var firstRow = rows.item(1);
Dan Beam 2013/08/13 00:30:43 nit: \n before every "td ="
Noam Samuel 2013/08/13 18:45:38 Done.
+ var td = firstRow.firstChild;
+ assertEquals('myService._privet._tcp.local', td.textContent);
+ td = td.nextSibling;
+ assertEquals('myservice.local', td.textContent);
+ td = td.nextSibling;
+ assertEquals('8888', td.textContent);
+ td = td.nextSibling;
+ assertEquals('1.2.3.4', td.textContent);
+ td = td.nextSibling;
+ assertEquals('unknown', td.textContent);
+ td = td.nextSibling;
+ assertEquals('Registered', td.textContent);
+}
+
+function checkTableHasNoRows() {
+ var rows = $('devices-table').querySelectorAll('tr');
+ assertEquals(1, rows.length);
+}

Powered by Google App Engine
This is Rietveld 408576698