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

Unified Diff: sky/tests/services/network.sky

Issue 868463008: Remove Client relationship between mojo.Shell/mojo.Application (Closed) Base URL: git@github.com:domokit/mojo.git@app_impl_init
Patch Set: fix android Created 5 years, 11 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: sky/tests/services/network.sky
diff --git a/sky/tests/services/network.sky b/sky/tests/services/network.sky
index 2d2c7c8e5e0f5a2ead641a2f1237a82a7bd9f3cf..6514af1b7cc2249e587b924f69f6bac33586c4ac 100644
--- a/sky/tests/services/network.sky
+++ b/sky/tests/services/network.sky
@@ -5,14 +5,19 @@
<import src="/mojo/public/sky/connection.sky" as="connection" />
<import src="/mojo/services/network/public/interfaces/network_service.mojom.sky" as="net" />
<import src="/mojo/services/network/public/interfaces/url_loader.mojom.sky" as="loader" />
-<import src="/mojo/services/public/sky/application.sky" as="application" />
+<import src="/mojo/services/public/sky/shell.sky" as="shell" />
+<import src="/mojo/public/interfaces/application/shell.mojom.sky" as="shellMojom" />
<script>
+const Shell = shell.Shell;
+
describe('Mojo network_service', function() {
this.enableTimeouts(false);
it('should be able to fetch text files', function(done) {
- var app = new application.Application(internals.passShellProxyHandle());
- var netService = app.shell.connectToService(
+ var shellHandle = internals.passShellProxyHandle();
+ var shellProxy = connection.bindHandleToProxy(shellHandle, shellMojom.Shell);
+ var shell = new Shell(shellProxy);
+ var netService = shell.connectToService(
"mojo:network_service", net.NetworkService);
var urlLoader;
@@ -24,11 +29,21 @@ describe('Mojo network_service', function() {
urlRequest.url = "http://127.0.0.1:8000/sky/tests/services/resources/pass.txt";
urlRequest.method = "GET";
urlRequest.auto_follow_redirects = true;
+
var urlRequestPromise = urlLoader.start(urlRequest);
urlRequestPromise.then(function(result) {
+ if (result.response.error) {
+ assert.ok(false, "network request failed " + result.response.error.code + " "
+ + result.response.error.description);
+ done();
+ }
console.log("url => " + result.response["url"]);
console.log("status_line => " + result.response["status_line"]);
console.log("mime_type => " + result.response["mime_type"]);
+
+ var start = Date.now();
+ while (Date.now() - start < 3) {}
+
var drainDataPromise = core.drainData(result.response.body);
drainDataPromise.then(function(result) {
console.log("read " + result.buffer.byteLength + " bytes");

Powered by Google App Engine
This is Rietveld 408576698