Added test for viewdocument.