This approach makes me really nervous.  There are several asynchronous processes here:

* The JavaScript engine
* The fake Youtube server
* The test thread itself

At some point, one of these processes will complete slower/faster than usual and will cause this test to fail intermittently.