<commit_before>$(document).ready ->
	module "Streaming Video"
	
	test "Check namespace", ->
		expect 2
		ok OAC.Client?, "OAC.Client"
		ok OAC.Client.StreamingVideo?, "OAC.Client.StreamingVideo"
	
	test "Check construction", ->
		expect 19
		app = OAC.Client.StreamingVideo.initApp "#content-container",
			playerWrapper: '#myplayer'
			url: 'http://www.youtube.com/watch?v=HYLacuAp76U&feature=fvsr'
			easement: 5

		ok $.isFunction(app.setActiveAnnotation), "setActiveAnnotation"
		ok $.isFunction(app.getActiveAnnotation), "getActiveAnnotation"
		
		ok $.isFunction(app.setCurrentTime), "setCurrentTime"
		ok $.isFunction(app.getCurrentTime), "getCurrenTime"
		
		ok $.isFunction(app.setTimeEasement), "setTimeEasement"
		ok $.isFunction(app.getTimeEasement), "getTimeEasement"
		ok $.isFunction(app.setCurrentMode), "setCurrentMode"
		ok $.isFunction(app.getCurrentMode), "getCurrentMode"
		ok $.isFunction(app.setPlayer), "setPlayer"
		ok $.isFunction(app.getPlayer), "getPlayer"
		
		ok $.isFunction(app.initShapeLens), "initShapeLens"
		ok $.isFunction(app.initTextLens), "initTextLens"
		ok $.isFunction(app.buttonFeature), "buttonFeature"
		ok $.isFunction(app.addShape), "addShape"
		ok $.isFunction(app.addBody), "addBody"
		ok $.isFunction(app.addShapeType), "addShapeType"
		ok $.isFunction(app.insertShape), "insertShape"
		ok $.isFunction(app.importData), "importData"
		ok $.isFunction(app.exportData), "exportData"
		
	test "Check annotation management", ->
		expect 12
		
		# We want to put a few annotations in
		app = OAC.Client.StreamingVideo.initApp "#content-container",
			playerWrapper: '#myplayer'
			url: 'http://www.youtube.com/watch?v=HYLacuAp76U&feature=fvsr'
			easement: 5
		
		app.run();
		
		app.setCurrentMode 'Rectangle'
		equal app.getCurrentMode(), 'Rectangle', "Setting mode to 'Rectangle' works"
		
		equal app.dataStore.canvas.items().length, 0, "Right number of items in data store"
		
		app.insertShape
			x: 100
			y: 100
			width: 50
			height: 50
		
		equal app.dataStore.canvas.items().length, 1, "Right number of items in data store"
		equal app.dataView.currentAnnotations.items().length, 1, "Right number of items in the data view"
			
		# move the time around
		app.setCurrentTime(20)
		# see which annotations are rendered
		equal app.getCurrentTime(), 20, "Time set"
		equal app.dataStore.canvas.items().length, 1, "Right number of items in data store"
		equal app.dataView.currentAnnotations.items().length, 0, "Right number of items in the data view"
		
		
		# move time back
		app.setCurrentTime(0)
		equal app.getCurrentTime(), 0, "Time set"
		equal app.dataStore.canvas.items().length, 1, "Right number of items in data store"
		equal app.dataView.currentAnnotations.items().length, 1, "Right number of items in the data view"
		
		# add another annotation
		app.insertShape
			x:200<commit_msg>Add test for annotation finding when current time changes<commit_after>$(document).ready ->
	module "Streaming Video"
	
	test "Check namespace", ->
		expect 2
		ok OAC.Client?, "OAC.Client"
		ok OAC.Client.StreamingVideo?, "OAC.Client.StreamingVideo"
	
	test "Check construction", ->
		expect 19
		app = OAC.Client.StreamingVideo.initApp "#content-container",
			playerWrapper: '#myplayer'
			url: 'http://www.youtube.com/watch?v=HYLacuAp76U&feature=fvsr'
			easement: 5

		ok $.isFunction(app.setActiveAnnotation), "setActiveAnnotation"
		ok $.isFunction(app.getActiveAnnotation), "getActiveAnnotation"
		
		ok $.isFunction(app.setCurrentTime), "setCurrentTime"
		ok $.isFunction(app.getCurrentTime), "getCurrenTime"
		
		ok $.isFunction(app.setTimeEasement), "setTimeEasement"
		ok $.isFunction(app.getTimeEasement), "getTimeEasement"
		ok $.isFunction(app.setCurrentMode), "setCurrentMode"
		ok $.isFunction(app.getCurrentMode), "getCurrentMode"
		ok $.isFunction(app.setPlayer), "setPlayer"
		ok $.isFunction(app.getPlayer), "getPlayer"
		
		ok $.isFunction(app.initShapeLens), "initShapeLens"
		ok $.isFunction(app.initTextLens), "initTextLens"
		ok $.isFunction(app.buttonFeature), "buttonFeature"
		ok $.isFunction(app.addShape), "addShape"
		ok $.isFunction(app.addBody), "addBody"
		ok $.isFunction(app.addShapeType), "addShapeType"
		ok $.isFunction(app.insertShape), "insertShape"
		ok $.isFunction(app.importData), "importData"
		ok $.isFunction(app.exportData), "exportData"
		
	test "Check annotation management", ->
		expect 12
		
		# We want to put a few annotations in
		app = OAC.Client.StreamingVideo.initApp "#content-container",
			playerWrapper: '#myplayer'
			url: 'http://www.youtube.com/watch?v=HYLacuAp76U&feature=fvsr'
			easement: 5
		app.run();
		
		app.setCurrentMode 'Rectangle'
		equal app.getCurrentMode(), 'Rectangle', "Setting mode to 'Rectangle' works"
		
		equal app.dataStore.canvas.items().length, 0, "Right number of items in data store"
		
		app.insertShape
			x: 100
			y: 100
			width: 50
			height: 50
		
		equal app.dataStore.canvas.items().length, 1, "Right number of items in data store"
		equal app.dataView.currentAnnotations.items().length, 1, "Right number of items in the data view"
			
		# move the time around
		app.setCurrentTime(20)
		# see which annotations are rendered
		equal app.getCurrentTime(), 20, "Time set"
		equal app.dataStore.canvas.items().length, 1, "Right number of items in data store"
		equal app.dataView.currentAnnotations.items().length, 0, "Right number of items in the data view"
		
		
		# move time back
		app.setCurrentTime(0)
		equal app.getCurrentTime(), 0, "Time set"
		equal app.dataStore.canvas.items().length, 1, "Right number of items in data store"
		equal app.dataView.currentAnnotations.items().length, 1, "Right number of items in the data view"
		
		app.setCurrentMode 'Rectangle'
		
		# add another annotation
		app.insertShape
			x:200
{'fraction_non_alphanumeric': 0.127096662631852, 'fraction_numerical': 0.012796126577900744, 'mean_word_length': 4.446327683615819, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2823471', 'n_tokens_mistral': 2148, 'n_tokens_neox': 1853, 'n_words': 471}