YARN-1868. YARN status web ui does not show correctly in IE 11. Contributed by Chuan Liu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1598686 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2014-05-30 18:07:23 +00:00
parent e4c06854b4
commit d599adcc6a
4 changed files with 14 additions and 3 deletions

View File

@ -171,6 +171,9 @@ Release 2.5.0 - UNRELEASED
that both Timeline Server and client can access them. (Zhijie Shen via
vinodkv)
YARN-1868. YARN status web ui does not show correctly in IE 11.
(Chuan Liu via cnauroth)
Release 2.4.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -79,7 +79,8 @@ protected HtmlPage(ViewContext ctx) {
@Override
public void render() {
puts(DOCTYPE);
render(page().html().meta_http("Content-type", MimeType.HTML));
render(page().html().meta_http("X-UA-Compatible", "IE=8")
.meta_http("Content-type", MimeType.HTML));
if (page().nestLevel() != 0) {
throw new WebAppException("Error rendering page: nestLevel="+
page().nestLevel());

View File

@ -70,6 +70,6 @@ public void render(Block html) {
out.flush();
verify(out).print("sub1 text");
verify(out).print("sub2 text");
verify(out, times(15)).println(); // test inline transition across views
verify(out, times(16)).println(); // test inline transition across views
}
}

View File

@ -22,11 +22,12 @@
import java.io.PrintWriter;
import org.apache.hadoop.yarn.webapp.MimeType;
import org.apache.hadoop.yarn.webapp.WebAppException;
import org.apache.hadoop.yarn.webapp.test.WebAppTests;
import org.apache.hadoop.yarn.webapp.view.HtmlPage;
import org.junit.Test;
import static org.mockito.Mockito.*;
public class TestHtmlPage {
@ -53,6 +54,12 @@ public void render(Page.HTML<_> html) {
Injector injector = WebAppTests.testPage(TestView.class);
PrintWriter out = injector.getInstance(PrintWriter.class);
// Verify the HTML page has correct meta tags in the header
verify(out).print(" http-equiv=\"X-UA-Compatible\"");
verify(out).print(" content=\"IE=8\"");
verify(out).print(" http-equiv=\"Content-type\"");
verify(out).print(String.format(" content=\"%s\"", MimeType.HTML));
verify(out).print("test");
verify(out).print(" id=\"testid\"");
verify(out).print("test note");