pull/7/head
yann300 9 years ago
parent 08f19ed20c
commit 1bc996620d
  1. 5
      src/Slider.js
  2. 4
      src/TxBrowser.js
  3. 58
      test-browser/index.js

@ -23,7 +23,8 @@ Slider.prototype.render = function () {
min=0 min=0
max=${this.max} max=${this.max}
value=0 value=0
onmouseup=${function () { self.onMouseUp() }} onkeyup=${function () { self.onChange() }}
onmouseup=${function () { self.onChange() }}
disabled=${this.disabled} /> disabled=${this.disabled} />
</div>` </div>`
if (!this.view) { if (!this.view) {
@ -39,7 +40,7 @@ Slider.prototype.init = function (length) {
this.setValue(0) this.setValue(0)
} }
Slider.prototype.onMouseUp = function (event) { Slider.prototype.onChange = function (event) {
var value = document.getElementById('slider').value var value = document.getElementById('slider').value
this.trigger('moved', [parseInt(value)]) this.trigger('moved', [parseInt(value)])
} }

@ -108,9 +108,9 @@ TxBrowser.prototype.render = function () {
<input onkeyup=${function () { self.updateBlockN(arguments[0]) }} type='text' placeholder=${'Block number (default 1000110)' + this.blockNumber} /> <input onkeyup=${function () { self.updateBlockN(arguments[0]) }} type='text' placeholder=${'Block number (default 1000110)' + this.blockNumber} />
<input id='txinput' onkeyup=${function () { self.updateTxN(arguments[0]) }} type='text' value=${this.txNumber} placeholder=${'Transaction Number or hash (default 2) ' + this.txNumber} /> <input id='txinput' onkeyup=${function () { self.updateTxN(arguments[0]) }} type='text' value=${this.txNumber} placeholder=${'Transaction Number or hash (default 2) ' + this.txNumber} />
<button id='load' onclick=${function () { self.submit() }}> <button id='load' onclick=${function () { self.submit() }}>
Get Load
</button> </button>
<button onclick=${function () { self.trigger('unloadRequested') }}>Unload</button> <button id='unload' onclick=${function () { self.trigger('unloadRequested') }}>Unload</button>
<div style=${ui.formatCss(style.transactionInfo)}> <div style=${ui.formatCss(style.transactionInfo)}>
<table> <table>
<tbody> <tbody>

@ -22,12 +22,68 @@ module.exports = {
.assert.containsText('#txhash', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') .assert.containsText('#txhash', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.assert.containsText('#txfrom', '0x00101c5bfa3fc8bad02c9f5fd65b069306251915') .assert.containsText('#txfrom', '0x00101c5bfa3fc8bad02c9f5fd65b069306251915')
.assert.containsText('#txto', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5') .assert.containsText('#txto', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#unload')
.waitForElementNotVisible('#vmdebugger', 1000)
.end() .end()
} },
'Stepping': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.checkCurrentSelectedItem('004 MSTORE')
.click('#intoforward')
.click('#intoback')
.click('#intoback')
.checkCurrentSelectedItem('002 PUSH 40')
.click('#nextcall')
.checkCurrentSelectedItem('181 CREATE')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#overforward')
.checkCurrentSelectedItem('058 RETURN')
.click('#intoforward')
.click('#overback')
.checkCurrentSelectedItem('181 CREATE')
.end()
},
'Slider': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.LEFT_ARROW)
.checkCurrentSelectedItem('041 PUSH 60fe47b1')
.end()
}
} }
function init (browser, callback) { function init (browser, callback) {
browser.checkCurrentSelectedItem = function (expected) {
browser.getValue('#asmitems', function (result) {
browser.assert.containsText('#asmitems option[value="' + result.value + '"]', expected)
})
return browser
}
browser browser
.url('http://127.0.0.1:8080') .url('http://127.0.0.1:8080')
injectScript('./test/resources/testWeb3.js', browser, function () { injectScript('./test/resources/testWeb3.js', browser, function () {

Loading…
Cancel
Save