Shayan's Software & Technology

My adventure as a Software Engineer continues..,

WebVTT 0.4 Release – Unit Testing the WebVTT Parser using Google’s GTest C++ Framework

Overview

The WebVTT 0.4 Release is here and I’ve written a fair amount of Unit Tests using Google’s GTest Framework to test our parser. I am testing to see if the parser is correctly parsing some of the escape characters that we have in the WebVTT standard. Incorrect escape characters are being outputted as garbage text to the user. I have written unit tests to verify this behavior under many conditions. Some conditions include to see if text is being outputted within tags, tags with class, tags within other tags and tags with sub classes.

The Unit Tests


/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
  Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&nsp;' instead of ' '
 Expected Output: '&nsp;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_NSP)
{
	loadVtt( "payload/escape-character/space-character-escape-nsp.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&nsp;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates To:
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 The Parser currently allows incorrect escapes to be outputted in the cue text string
 Expected Output: '&nbp'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_NBP)
{
	loadVtt( "payload/escape-character/space-character-escape-nbp.vtt", 1 );

	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&nbp", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );

}
/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
  Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&bsp;' instead of ' '
 Expected Output: '&bsp;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_BSP)
{
	loadVtt( "payload/escape-character/space-character-escape-bsp.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&bsp;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&bp;' instead of ' '
 Expected Output: '&bp;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_BP)
{
	loadVtt( "payload/escape-character/space-character-escape-bp.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&bp;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );

}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&b;' instead of ' '
 Expected Output: '&b;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_B)
{
	loadVtt( "payload/escape-character/space-character-escape-b.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&b;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&s;' instead of ' '
 Expected Output: '&s;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_S)
{
	loadVtt( "payload/escape-character/space-character-escape-bsp.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&s;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&ns;' instead of ' '
 Expected Output: '&ns;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_NS)
{
	loadVtt( "payload/escape-character/space-character-escape-ns.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&ns;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&np;' instead of ' '
 Expected Output: '&np;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_NP)
{
	loadVtt( "payload/escape-character/space-character-escape-np.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&np", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&sp;' instead of ' '
 Expected Output: '&sp;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_SP)
{
	loadVtt( "payload/escape-character/space-character-escape-sp.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&sp;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&p;' instead of ' '
 Expected Output: '&p;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_P)
{
	loadVtt( "payload/escape-character/space-character-escape-p.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&p;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&bs;' instead of ' '
 Expected Output: '&bs;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_BS)
{
	loadVtt( "payload/escape-character/space-character-escape-bs.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&bs;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&lr;' instead of '‎'
 Expected Output: '&lr;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_LeftToRight)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-lr.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&lr;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&l;' instead of '‎'
 Expected Output: '&l;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_L)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-l.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&l;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&lm;' instead of '‎'
 Expected Output: '&lm;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_LM)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-lm.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&lm;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&rm;' instead of '‎'
 Expected Output: '&rm;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_RM)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-rm.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&rm;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&m;' instead of '‎'
 Expected Output: '&m;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_M)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-m.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&m;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&r;' instead of '‎'
 Expected Output: '&r;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_R)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-r.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&r;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&lm;' instead of '‎'
 Expected Output: '&lm;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_LM_LeftToRight)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-lm.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&lm;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Left to Right Character Escape : '&rl;' instead of '‎'
 Expected Output: '&rl;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_RL)
{
	loadVtt( "payload/escape-character/left-to-right-character-escape-rl.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&rl;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*  
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Expected Output: '&'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_AmpersandCharacter)
{
	loadVtt( "payload/escape-character/ampersand-character-escape.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Ampersand Escape : '&a;' instead of '&'
 Expected Output: '&a;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_A)
{
	loadVtt( "payload/escape-character/ampersand-character-escape-a.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&a;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Ampersand Escape : '&am;' instead of '&'
 Expected Output: '&am;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_AM)
{
	loadVtt( "payload/escape-character/ampersand-character-escape-a.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&am;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Ampersand Escape : '∓' instead of '&'
 Expected Output: '∓'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_MP)
{
	loadVtt( "payload/escape-character/ampersand-character-escape-mp.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"∓", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Ampersand Escape : '&p;' instead of '&'
 Expected Output: '&p;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_P_Ampersand)
{
	loadVtt( "payload/escape-character/ampersand-character-escape-p.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&p;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Ampersand Escape : '≈' instead of '&'
 Expected Output: '≈'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_AP)
{
	loadVtt( "payload/escape-character/ampersand-character-escape-ap.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"≈", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Less Than Escape : '&l;' instead of '<'
 Expected Output: '&l;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_LessThan)
{
	loadVtt( "payload/escape-character/less-than-character-escape-l.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&l;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Less Than Escape : '&t;' instead of '<'
 Expected Output: '&t;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_T)
{
	loadVtt( "payload/escape-character/less-than-character-escape-t.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&t;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Greater Than Escape : '&g;' instead of '>'
 Expected Output: '&g;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_GreaterThan)
{
	loadVtt( "payload/escape-character/greater-than-character-escape-g.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&g;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&nbs;' instead of ' '
 Expected Output: '&nbs;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_NBS)
{
	loadVtt( "payload/escape-character/space-character-escape-nbs.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&nbs;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&nb;' instead of ' '
 Expected Output: '&nb;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_NB)
{
	loadVtt( "payload/escape-character/space-character-escape-nb.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&nb;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/* 
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 Incorrect Space Character Escape : '&n;' instead of ' '
 Expected Output: '&n;'
*/
TEST_F(PayloadEscapeCharacter,DISABLED_N)
{
	loadVtt( "payload/escape-character/space-character-escape-n.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();
	String expectedText = String( (const byte *)"&n;", 1 );

	ASSERT_EQ( expectedText.text(), node->content().text() );
}

Format Specific Tests




/*
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates to: 
 Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 

 correct Ampersand Character Escape : within a cue i tag
*/
TEST_F(PayloadFormat,DISABLED_AmpersandWithinTag)
{
	loadVtt( "payload/escape-character/i-tag-with-ampersand.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates To:
 Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape : cue b tag within a cue i tag
*/
TEST_F(PayloadFormat,DISABLED_AmpersandWithinMultipleTags)
{
	loadVtt( "payload/escape-character/i-tag-within-b-tag-with-ampersand.vtt", 1 );

	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
  Relates To:
  Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape outside cue b tag within a cue i tag
*/
TEST_F(PayloadFormat,DISABLED_AmpersandOutsideTwoTags)
{
	loadVtt( "payload/escape-character/i-tag-within-b-tag-with-ampersand-outside.vtt", 1 );

	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates To:
 Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape on new line after two encapsulated tags with class
*/
TEST_F(PayloadFormat,DISABLED_AmpersandOnNewLineAfterTwoTagsWithClass)
{
	loadVtt( "payload/escape-character/ampersand-outside-tag-on-newline-with-class.vtt", 1 );

	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
  Relates To:
  Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape inside tag with a class
*/
TEST_F(PayloadFormat,DISABLED_AmpersandInsideOneTagWithClass)
{
	loadVtt( "payload/escape-character/ampersand-within-tag-with-class.vtt", 1 );
		const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
  Relates To:
  Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape inside a tag with a subclass
 and subclass
*/
TEST_F(PayloadFormat,DISABLED_AmpersandInsideTagWithSubclasses)
{
	loadVtt( "payload/escape-character/ampersand-inside-tag-with-subclass.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
 Relates To:
 Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape on line after a tag with a class
 and subclass
*/
TEST_F(PayloadFormat,DISABLED_AmpersandOnLineWithClassAndSubClass)
{
	loadVtt( "payload/escape-character/ampersand-inside-tag--with-subclass.vtt", 1 );
	const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
/*
 WebVTT Specification Version:
 WebVTT - Living Standard Last Updated 2 October 2012
 
  Relates To:
  Cue Text Escape Characters and Cue Text Tags: 
 http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
 
 Description:
 correct Ampersand Character Escape on new line after a tag with a class
 and subclass
*/
TEST_F(PayloadFormat,DISABLED_AmpersandOnNewlineWithClassAndSubclass)
{
	loadVtt( "payload/escape-character/ampersand-outside-tag-on-newline-with-subclass.vtt", 1 );
		const TextNode *node = getHeadOfCue( 0 )->child( 0 )->toTextNode();

	String expectedText = String( (const byte *)"&", 1 );
	ASSERT_EQ( expectedText.text(), node->content().text() );
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: