Properly check for EGL_KHR_create_context before creating ES3 context.

Mark EGL_KHR_create_context as supported in the DisplayGLs.

BUG=angleproject:1149

Change-Id: I20671535680eb2c3b9c08205cee243b3aa5c5821
Reviewed-on: https://chromium-review.googlesource.com/297080
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm b/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
index efeea31..cba52cb 100644
--- a/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
+++ b/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
@@ -119,7 +119,7 @@
 
 void DisplayCGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
 {
-    UNIMPLEMENTED();
+    outExtensions->createContext = true;
 }
 
 void DisplayCGL::generateCaps(egl::Caps *outCaps) const
diff --git a/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp b/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
index 4c14474..1d2d073 100644
--- a/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
+++ b/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
@@ -452,7 +452,7 @@
 
 void DisplayGLX::generateExtensions(egl::DisplayExtensions *outExtensions) const
 {
-    // UNIMPLEMENTED();
+    outExtensions->createContext = true;
 }
 
 void DisplayGLX::generateCaps(egl::Caps *outCaps) const
diff --git a/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp b/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
index 81418bf..7f293b5 100644
--- a/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
+++ b/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
@@ -466,7 +466,7 @@
 
 void DisplayWGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
 {
-    //UNIMPLEMENTED();
+    outExtensions->createContext = true;
 }
 
 void DisplayWGL::generateCaps(egl::Caps *outCaps) const
diff --git a/src/tests/gl_tests/ProgramBinaryTest.cpp b/src/tests/gl_tests/ProgramBinaryTest.cpp
index fb175d9..8f950f1 100644
--- a/src/tests/gl_tests/ProgramBinaryTest.cpp
+++ b/src/tests/gl_tests/ProgramBinaryTest.cpp
@@ -201,7 +201,8 @@
 
     EGLWindow *createAndInitEGLWindow(angle::PlatformParameters &param)
     {
-        EGLWindow *eglWindow = new EGLWindow(param.majorVersion, param.eglParameters);
+        EGLWindow *eglWindow =
+            new EGLWindow(param.majorVersion, param.minorVersion, param.eglParameters);
         bool result = eglWindow->initializeGL(mOSWindow);
         if (result == false)
         {
diff --git a/src/tests/perf_tests/ANGLEPerfTest.cpp b/src/tests/perf_tests/ANGLEPerfTest.cpp
index 28b0ba0..6681fa7 100644
--- a/src/tests/perf_tests/ANGLEPerfTest.cpp
+++ b/src/tests/perf_tests/ANGLEPerfTest.cpp
@@ -105,7 +105,8 @@
 void ANGLERenderTest::SetUp()
 {
     mOSWindow = CreateOSWindow();
-    mEGLWindow = new EGLWindow(mTestParams.majorVersion, mTestParams.eglParameters);
+    mEGLWindow = new EGLWindow(mTestParams.majorVersion, mTestParams.minorVersion,
+                               mTestParams.eglParameters);
     mEGLWindow->setSwapInterval(0);
 
     if (!mOSWindow->initialize(mName, mTestParams.windowWidth, mTestParams.windowHeight))
diff --git a/src/tests/test_utils/ANGLETest.cpp b/src/tests/test_utils/ANGLETest.cpp
index 38ec890..fe1a1e7 100644
--- a/src/tests/test_utils/ANGLETest.cpp
+++ b/src/tests/test_utils/ANGLETest.cpp
@@ -7,7 +7,8 @@
       mWidth(0),
       mHeight(0)
 {
-    mEGLWindow = new EGLWindow(GetParam().majorVersion, GetParam().eglParameters);
+    mEGLWindow =
+        new EGLWindow(GetParam().majorVersion, GetParam().minorVersion, GetParam().eglParameters);
 }
 
 ANGLETest::~ANGLETest()
@@ -201,7 +202,7 @@
 
 int ANGLETest::getClientVersion() const
 {
-    return mEGLWindow->getClientVersion();
+    return mEGLWindow->getClientMajorVersion();
 }
 
 EGLWindow *ANGLETest::getEGLWindow() const
diff --git a/src/tests/test_utils/angle_test_instantiate.cpp b/src/tests/test_utils/angle_test_instantiate.cpp
index 3e65375..a928d85 100644
--- a/src/tests/test_utils/angle_test_instantiate.cpp
+++ b/src/tests/test_utils/angle_test_instantiate.cpp
@@ -63,7 +63,8 @@
 
         if (result)
         {
-            EGLWindow *eglWindow = new EGLWindow(param.majorVersion, param.eglParameters);
+            EGLWindow *eglWindow =
+                new EGLWindow(param.majorVersion, param.minorVersion, param.eglParameters);
             result = eglWindow->initializeGL(osWindow);
 
             eglWindow->destroyGL();