2015-08-03 17:07:48 +00:00
|
|
|
// Copyright 2015 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
if (this.Worker) {
|
2018-09-19 23:30:04 +00:00
|
|
|
var __v_7 = new Worker('onmessage = function() {};', {type: 'string'});
|
2017-01-27 20:15:37 +00:00
|
|
|
var e;
|
2017-02-17 18:55:54 +00:00
|
|
|
var ab = new ArrayBuffer(2 * 1000 * 1000);
|
2015-08-03 17:07:48 +00:00
|
|
|
try {
|
2017-02-17 18:55:54 +00:00
|
|
|
__v_7.postMessage(ab);
|
|
|
|
threw = false;
|
2015-08-03 17:07:48 +00:00
|
|
|
} catch (e) {
|
2017-02-17 18:55:54 +00:00
|
|
|
// postMessage failed, should be a DataCloneError message.
|
|
|
|
assertContains('cloned', e.message);
|
|
|
|
threw = true;
|
2015-08-03 17:07:48 +00:00
|
|
|
}
|
2017-02-17 18:55:54 +00:00
|
|
|
assertTrue(threw, 'Should throw when trying to serialize large message.');
|
2015-08-03 17:07:48 +00:00
|
|
|
}
|