| OLD | NEW |
| 1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Class to track the progress events received by a particular plugin instance. | 5 // Class to track the progress events received by a particular plugin instance. |
| 6 function EventStateMachine() { | 6 function EventStateMachine() { |
| 7 // Work around how JS binds 'this'. | 7 // Work around how JS binds 'this'. |
| 8 var this_ = this; | 8 var this_ = this; |
| 9 // Given a particular state, what are the acceptable event types. | 9 // Given a particular state, what are the acceptable event types. |
| 10 this.expectedNext = { | 10 this.expectedNext = { |
| 11 'BEGIN': { 'loadstart': 1 }, | 11 'BEGIN': { 'loadstart': 1 }, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 tester.addTest('last_error_string_' + embedId, function() { | 140 tester.addTest('last_error_string_' + embedId, function() { |
| 141 // If an error or abort was reported, check that lastError is set | 141 // If an error or abort was reported, check that lastError is set |
| 142 // to the correct value. | 142 // to the correct value. |
| 143 if ((eventMachine.stateHistogram['error'] > 0 || | 143 if ((eventMachine.stateHistogram['error'] > 0 || |
| 144 eventMachine.stateHistogram['abort'] > 0)) { | 144 eventMachine.stateHistogram['abort'] > 0)) { |
| 145 var embed = $(embedId); | 145 var embed = $(embedId); |
| 146 assertEqual(embed.lastError, lastError); | 146 assertEqual(embed.lastError, lastError); |
| 147 } | 147 } |
| 148 }); | 148 }); |
| 149 } | 149 } |
| OLD | NEW |