@@ -177,7 +177,8 @@ ops.OperationTests = function OperationTests(runner) {
177177 opsElement = before . nextElementSibling ,
178178 after = opsElement . nextElementSibling ,
179179 ops = [ ] ,
180- op ,
180+ opElement , opspec ,
181+ now = Date . now ( ) ,
181182 setup ;
182183 runtime . assert ( before . localName === "before" , "Expected <before/> in " + name + "." ) ;
183184 runtime . assert ( checkWhitespace ( before , "s" , " " ) , "Unexpanded text:s element or text:c attribute found in " + name + "." ) ;
@@ -187,11 +188,20 @@ ops.OperationTests = function OperationTests(runner) {
187188 runtime . assert ( checkWhitespace ( after , "s" , " " ) , "Unexpanded text:s element or text:c attribute found in " + name + "." ) ;
188189 runtime . assert ( checkWhitespace ( after , "tab" , "\t" ) , "Unexpanded text:tab element found in " + name + "." ) ;
189190 opsTestHelper . removeInsignificantTextNodes ( node ) ;
190- op = opsElement . firstElementChild ;
191- while ( op ) {
192- runtime . assert ( op . localName === "op" , "Expected <op/> in " + name + "." ) ;
193- ops . push ( parseOperation ( op ) ) ;
194- op = op . nextElementSibling ;
191+ opElement = opsElement . firstElementChild ;
192+ while ( opElement ) {
193+ runtime . assert ( opElement . localName === "op" , "Expected <op/> in " + name + "." ) ;
194+ opspec = parseOperation ( opElement ) ;
195+ // default to Alice
196+ if ( ! opspec . memberid ) {
197+ opspec . memberid = 'Alice' ;
198+ }
199+ // default to now
200+ if ( ! opspec . timestamp ) {
201+ opspec . timestamp = now ;
202+ }
203+ ops . push ( opspec ) ;
204+ opElement = opElement . nextElementSibling ;
195205 }
196206 setup = self . setUps . hasOwnProperty ( name ) ? self . setUps [ name ] ( ) : null ;
197207 if ( hasSetup ) {
@@ -259,7 +269,6 @@ ops.OperationTests = function OperationTests(runner) {
259269 factory = new ops . OperationFactory ( ) ,
260270 i ,
261271 op ,
262- events ,
263272 textbefore = getOfficeTextElement ( test . before ) ,
264273 textafter = getOfficeTextElement ( test . after ) ,
265274 styles = t . odfContainer . rootElement . styles ,
@@ -290,12 +299,7 @@ ops.OperationTests = function OperationTests(runner) {
290299 // execute test ops
291300 for ( i = 0 ; i < test . ops . length ; i += 1 ) {
292301 op = /**@type {!ops.Operation }*/ ( factory . create ( test . ops [ i ] ) ) ;
293- t . odtDocument . prepareOperationExecution ( op ) ;
294- events = op . execute ( t . odtDocument ) ;
295- if ( metabefore ) {
296- t . odtDocument . finishOperationExecution ( op ) ;
297- }
298- t . odtDocument . emitEvents ( events ) ;
302+ t . odtDocument . executeOperation ( op ) ;
299303 checkForEmptyTextNodes ( t . odtDocument . getCanvas ( ) . getElement ( ) ) ;
300304 }
301305
@@ -406,18 +410,20 @@ ops.OperationTests = function OperationTests(runner) {
406410 }
407411
408412 this . setUp = function ( ) {
409- var testarea , properties ;
413+ var testarea ;
410414 t = { } ;
411415 testarea = core . UnitTest . provideTestAreaDiv ( ) ;
412416 t . odfcanvas = new odf . OdfCanvas ( testarea ) ;
413417 t . odfContainer = new odf . OdfContainer ( odf . OdfContainer . DocumentType . TEXT , null ) ;
414418 t . odfcanvas . setOdfContainer ( t . odfContainer ) ;
415419 t . odtDocument = new ops . OdtDocument ( t . odfcanvas ) ;
416- properties = new ops . MemberProperties ( ) ;
417- properties . color = "black" ;
418- properties . fullName = "Alice" ;
419- properties . imageUrl = "" ;
420- t . odtDocument . addMember ( new ops . Member ( 'Alice' , properties ) ) ;
420+ [ "Alice" , "Bob" , "Eve" , "Joe" ] . forEach ( function ( name ) {
421+ var properties = new ops . MemberProperties ( ) ;
422+ properties . color = "black" ;
423+ properties . fullName = name ;
424+ properties . imageUrl = "" ;
425+ t . odtDocument . addMember ( new ops . Member ( name , properties ) ) ;
426+ } ) ;
421427 } ;
422428 this . tearDown = function ( ) {
423429 t . odfcanvas . destroy ( function ( ) { return ; } ) ;
0 commit comments