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

Unified Diff: mojo/public/js/tests/validation_unittest.js

Issue 2744963002: Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: Add binding.html layout test for connection error with reason. Reset IEC when reset() or close()… Created 3 years, 9 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: mojo/public/js/tests/validation_unittest.js
diff --git a/mojo/public/js/tests/validation_unittest.js b/mojo/public/js/tests/validation_unittest.js
index 2a70248e662ef561f0fa900b4ac51c3c6ab8f6c3..20ebd8659436329cc23302f7ddcb2fe9ad993f55 100644
--- a/mojo/public/js/tests/validation_unittest.js
+++ b/mojo/public/js/tests/validation_unittest.js
@@ -278,15 +278,10 @@ define([
expect(testMessagePipe.result).toBe(core.RESULT_OK);
endpoint.bind(testMessagePipe.handle1);
- var testingController = endpoint.enableTestingMode();
-
- var validationError;
- testingController.setInvalidIncomingMessageHandler(function(error) {
- validationError = error;
- });
+ var observer = validator.ValidationErrorObserverForTesting.getInstance();
for (var i = 0; i < testFiles.length; i++) {
- validationError = noError;
+ observer.reset();
yzshen1 2017/03/24 21:20:13 nit: you could move this line to the end of the fo
wangjimmy 2017/03/27 16:51:28 Done.
var testMessage = readTestMessage(testFiles[i]);
var handles = new Array(testMessage.handleCount);
@@ -297,8 +292,8 @@ define([
core.WRITE_MESSAGE_FLAG_NONE);
expect(writeMessageValue).toBe(core.RESULT_OK);
- testingController.waitForNextMessage();
- checkValidationResult(testFiles[i], validationError);
+ endpoint.waitForNextMessageForTesting();
+ checkValidationResult(testFiles[i], observer.lastError);
}
expect(core.close(testMessagePipe.handle0)).toBe(core.RESULT_OK);
@@ -333,6 +328,7 @@ define([
testIntegratedMessageHeaderValidation();
testIntegratedResponseMessageValidation();
testIntegratedRequestMessageValidation();
+ validator.clearTestingMode();
this.result = "PASS";
});

Powered by Google App Engine
This is Rietveld 408576698