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

Unified Diff: chrome/test/data/extensions/api_test/web_socket_proxy_private/background.html

Issue 8762014: Move another set of extension tests to manifest_version 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/extensions/api_test/web_socket_proxy_private/background.html
===================================================================
--- chrome/test/data/extensions/api_test/web_socket_proxy_private/background.html (revision 112170)
+++ chrome/test/data/extensions/api_test/web_socket_proxy_private/background.html (working copy)
@@ -1,54 +1,6 @@
-<script>
- var hostname = '127.0.0.1';
- var port = -1;
-
- function testModernApi() {
- function gotMessage(msg) {
- chrome.test.assertEq(msg.data, window.btoa("aloha\n"));
- }
-
- function gotUrl(url) {
- var url_regex = /^ws:\/\//
- chrome.test.assertEq(0, url.search(url_regex));
- ws = new WebSocket(url);
-
- function gotMessage(msg) {
- // chrome.test.callbackPass envelope works only once, remove it.
- ws.onmessage = gotMessage;
- }
-
- // We should get response from HTTP test server.
- ws.onmessage = chrome.test.callbackPass(gotMessage);
-
- ws.onopen = function() {
- var request = ["GET / HTTP/1.1",
- "Host: 127.0.0.1:" + port,
- "Connection: keep-alive",
- "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.54 Safari/535.2",
- "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
- "", ""].join("\r\n");
- ws.send(window.btoa(request));
- };
- }
-
- chrome.webSocketProxyPrivate.getURLForTCP(
- hostname, port, { "tls": false }, chrome.test.callbackPass(gotUrl));
- }
-
- function testObsoleteApi() {
- function gotPassport(passport) {
- chrome.test.assertEq('string', typeof(passport));
- chrome.test.assertTrue(passport.length > 5); // Short one is insecure.
- }
-
- chrome.webSocketProxyPrivate.getPassportForTCP(
- hostname, port, chrome.test.callbackPass(gotPassport));
- }
-
- function setTestServerPortAndProceed(testConfig) {
- port = testConfig.testServer.port;
- chrome.test.runTests([testModernApi, testObsoleteApi]);
- }
-
- chrome.test.getConfig(setTestServerPortAndProceed);
-</script>
+<!--
+ * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
+ * source code is governed by a BSD-style license that can be found in the
+ * LICENSE file.
+-->
+<script src="background.js"></script>

Powered by Google App Engine
This is Rietveld 408576698