Index: test/mjsunit/wasm/memory.js |
diff --git a/test/mjsunit/wasm/memory.js b/test/mjsunit/wasm/memory.js |
index e86825bd27c7000a88c047e5b392d1e9e386b377..1fbe0581b170d11581ea8f8130193b0be73ec3fd 100644 |
--- a/test/mjsunit/wasm/memory.js |
+++ b/test/mjsunit/wasm/memory.js |
@@ -91,3 +91,13 @@ function assertMemoryIsValid(memory) { |
assertThrows(() => {'use strict'; memory.buffer = memory.buffer}, TypeError) |
assertThrows(() => ({__proto__: memory}).buffer, TypeError) |
})(); |
+ |
+(function TestMemoryGrow() { |
+ var kPageSize = 65536; |
+ let memory = new WebAssembly.Memory({initial: 1, maximum:30}); |
+ assertEquals(1, memory.grow(9)); |
+ assertTrue(memory.buffer instanceof ArrayBuffer); |
+ assertTrue(10*kPageSize == memory.buffer.byteLength); |
+ assertMemoryIsValid(memory); |
+ assertThrows(() => memory.grow(21)); |
+})(); |