diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 279127bf..43b556f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -160,8 +160,11 @@
         }
 
         @Override
-        public void onNetworkQualityEstimate(WebContents webContents, int effectiveConnectionType,
-                long httpRttMs, long transportRttMs) {
+        public void onNewNavigation(WebContents webContents, long navigationId) {}
+
+        @Override
+        public void onNetworkQualityEstimate(WebContents webContents, long navigationId,
+                int effectiveConnectionType, long httpRttMs, long transportRttMs) {
             if (webContents != mWebContents) return;
 
             Bundle args = new Bundle();
@@ -172,8 +175,8 @@
         }
 
         @Override
-        public void onFirstContentfulPaint(
-                WebContents webContents, long navigationStartTick, long firstContentfulPaintMs) {
+        public void onFirstContentfulPaint(WebContents webContents, long navigationId,
+                long navigationStartTick, long firstContentfulPaintMs) {
             if (webContents != mWebContents) return;
 
             mConnection.notifySinglePageLoadMetric(mSession, PageLoadMetrics.FIRST_CONTENTFUL_PAINT,
@@ -181,17 +184,17 @@
         }
 
         @Override
-        public void onLoadEventStart(
-                WebContents webContents, long navigationStartTick, long loadEventStartMs) {
+        public void onLoadEventStart(WebContents webContents, long navigationId,
+                long navigationStartTick, long loadEventStartMs) {
             if (webContents != mWebContents) return;
             mConnection.notifySinglePageLoadMetric(mSession, PageLoadMetrics.LOAD_EVENT_START,
                     navigationStartTick, loadEventStartMs);
         }
 
         @Override
-        public void onLoadedMainResource(WebContents webContents, long dnsStartMs, long dnsEndMs,
-                long connectStartMs, long connectEndMs, long requestStartMs, long sendStartMs,
-                long sendEndMs) {
+        public void onLoadedMainResource(WebContents webContents, long navigationId,
+                long dnsStartMs, long dnsEndMs, long connectStartMs, long connectEndMs,
+                long requestStartMs, long sendStartMs, long sendEndMs) {
             if (webContents != mWebContents) return;
 
             Bundle args = new Bundle();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java
index 8fafe13..04093433 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java
@@ -33,6 +33,15 @@
     /** Observer for page load metrics. */
     public interface Observer {
         /**
+         * Called when the new navigation is started. It's guaranteed to be called before any other
+         * function with the same navigationId.
+         *
+         * @param webContents the WebContents this metrics is related to.
+         * @param navigationId the unique id of a navigation this metrics is related to.
+         */
+        public void onNewNavigation(WebContents webContents, long navigationId);
+
+        /**
          * Called when Network Quality Estimate is available, once per page load, when the
          * load is started. This is guaranteed to be called before any other metric event
          * below. If Chromium has just been started, this will likely be determined from
@@ -40,46 +49,50 @@
          * probably similar to what the ConnectivityManager reports.
          *
          * @param webContents the WebContents this metrics is related to.
+         * @param navigationId the unique id of a navigation this metrics is related to.
          * @param effectiveConnectionType the effective connection type, see
          *     net::EffectiveConnectionType.
          * @param httpRttMs an estimate of HTTP RTT, in milliseconds. Will be zero if unknown.
          * @param transportRttMs an estimate of transport RTT, in milliseconds. Will be zero
          *     if unknown.
          */
-        public void onNetworkQualityEstimate(WebContents webContents, int effectiveConnectionType,
-                long httpRttMs, long transportRttMs);
+        public void onNetworkQualityEstimate(WebContents webContents, long navigationId,
+                int effectiveConnectionType, long httpRttMs, long transportRttMs);
 
         /**
          * Called when the first contentful paint page load metric is available.
          *
          * @param webContents the WebContents this metrics is related to.
+         * @param navigationId the unique id of a navigation this metrics is related to.
          * @param navigationStartTick Absolute navigation start time, as TimeTicks.
          * @param firstContentfulPaintMs Time to first contentful paint from navigation start.
          */
-        public void onFirstContentfulPaint(
-                WebContents webContents, long navigationStartTick, long firstContentfulPaintMs);
+        public void onFirstContentfulPaint(WebContents webContents, long navigationId,
+                long navigationStartTick, long firstContentfulPaintMs);
 
         /**
          * Called when the load event start metric is available.
          *
          * @param webContents the WebContents this metrics is related to.
+         * @param navigationId the unique id of a navigation this metrics is related to.
          * @param navigationStartTick Absolute navigation start time, as TimeTicks.
          * @param loadEventStartMs Time to load event start from navigation start.
          */
-        public void onLoadEventStart(
-                WebContents webContents, long navigationStartTick, long loadEventStartMs);
+        public void onLoadEventStart(WebContents webContents, long navigationId,
+                long navigationStartTick, long loadEventStartMs);
 
         /**
          * Called when the main resource is loaded.
          *
          * @param webContents the WebContents this metrics is related to.
+         * @param navigationId the unique id of a navigation this metrics is related to.
          *
          * Remaining parameters are timing information in milliseconds from a common
          * arbitrary point (such as, but not guaranteed to be, system start).
          */
-        public void onLoadedMainResource(WebContents webContents, long dnsStartMs, long dnsEndMs,
-                long connectStartMs, long connectEndMs, long requestStartMs, long sendStartMs,
-                long sendEndMs);
+        public void onLoadedMainResource(WebContents webContents, long navigationId,
+                long dnsStartMs, long dnsEndMs, long connectStartMs, long connectEndMs,
+                long requestStartMs, long sendStartMs, long sendEndMs);
     }
 
     private static ObserverList<Observer> sObservers;
@@ -99,46 +112,56 @@
     }
 
     @CalledByNative
-    static void onNetworkQualityEstimate(WebContents webContents, int effectiveConnectionType,
-            long httpRttMs, long transportRttMs) {
+    static void onNewNavigation(WebContents webContents, long navigationId) {
+        ThreadUtils.assertOnUiThread();
+        if (sObservers == null) return;
+        for (Observer observer : sObservers) {
+            observer.onNewNavigation(webContents, navigationId);
+        }
+    }
+
+    @CalledByNative
+    static void onNetworkQualityEstimate(WebContents webContents, long navigationId,
+            int effectiveConnectionType, long httpRttMs, long transportRttMs) {
         ThreadUtils.assertOnUiThread();
         if (sObservers == null) return;
         for (Observer observer : sObservers) {
             observer.onNetworkQualityEstimate(
-                    webContents, effectiveConnectionType, httpRttMs, transportRttMs);
+                    webContents, navigationId, effectiveConnectionType, httpRttMs, transportRttMs);
         }
     }
 
     @CalledByNative
-    static void onFirstContentfulPaint(
-            WebContents webContents, long navigationStartTick, long firstContentfulPaintMs) {
+    static void onFirstContentfulPaint(WebContents webContents, long navigationId,
+            long navigationStartTick, long firstContentfulPaintMs) {
         ThreadUtils.assertOnUiThread();
         if (sObservers == null) return;
         for (Observer observer : sObservers) {
             observer.onFirstContentfulPaint(
-                    webContents, navigationStartTick, firstContentfulPaintMs);
+                    webContents, navigationId, navigationStartTick, firstContentfulPaintMs);
         }
     }
 
     @CalledByNative
-    static void onLoadEventStart(
-            WebContents webContents, long navigationStartTick, long loadEventStartMs) {
+    static void onLoadEventStart(WebContents webContents, long navigationId,
+            long navigationStartTick, long loadEventStartMs) {
         ThreadUtils.assertOnUiThread();
         if (sObservers == null) return;
         for (Observer observer : sObservers) {
-            observer.onLoadEventStart(webContents, navigationStartTick, loadEventStartMs);
+            observer.onLoadEventStart(
+                    webContents, navigationId, navigationStartTick, loadEventStartMs);
         }
     }
 
     @CalledByNative
-    static void onLoadedMainResource(WebContents webContents, long dnsStartMs, long dnsEndMs,
-            long connectStartMs, long connectEndMs, long requestStartMs, long sendStartMs,
-            long sendEndMs) {
+    static void onLoadedMainResource(WebContents webContents, long navigationId, long dnsStartMs,
+            long dnsEndMs, long connectStartMs, long connectEndMs, long requestStartMs,
+            long sendStartMs, long sendEndMs) {
         ThreadUtils.assertOnUiThread();
         if (sObservers == null) return;
         for (Observer observer : sObservers) {
-            observer.onLoadedMainResource(webContents, dnsStartMs, dnsEndMs, connectStartMs,
-                    connectEndMs, requestStartMs, sendStartMs, sendEndMs);
+            observer.onLoadedMainResource(webContents, navigationId, dnsStartMs, dnsEndMs,
+                    connectStartMs, connectEndMs, requestStartMs, sendStartMs, sendEndMs);
         }
     }
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/PageLoadMetricsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/PageLoadMetricsTest.java
index e41a4bb..4c5aa2b4 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/PageLoadMetricsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/metrics/PageLoadMetricsTest.java
@@ -42,9 +42,10 @@
 
     private static final int PAGE_LOAD_METRICS_TIMEOUT_MS = 3000;
     private static final String TEST_PAGE = "/chrome/test/data/android/google.html";
-    private static final String TEST_PAGE_TITLE = "The Google";
+    private static final String TEST_PAGE_2 = "/chrome/test/data/android/test.html";
 
     private String mTestPage;
+    private String mTestPage2;
     private EmbeddedTestServer mTestServer;
     private PageLoadMetricsObserver mMetricsObserver;
 
@@ -53,6 +54,7 @@
         mActivityTestRule.startMainActivityOnBlankPage();
         mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
         mTestPage = mTestServer.getURL(TEST_PAGE);
+        mTestPage2 = mTestServer.getURL(TEST_PAGE_2);
 
         mMetricsObserver =
                 new PageLoadMetricsObserver(mActivityTestRule.getActivity().getActivityTab());
@@ -60,37 +62,49 @@
 
     @After
     public void tearDown() throws Exception {
-        ThreadUtils.runOnUiThreadBlocking(new Runnable() {
-            @Override
-            public void run() {
-                PageLoadMetrics.removeObserver(mMetricsObserver);
-            }
-        });
+        ThreadUtils.runOnUiThreadBlocking(
+                (Runnable) () -> PageLoadMetrics.removeObserver(mMetricsObserver));
 
         mTestServer.stopAndDestroyServer();
     }
 
+    private void assertMetricsEmitted(PageLoadMetricsObserver observer)
+            throws InterruptedException {
+        Assert.assertTrue("First Contentful Paint should be reported",
+                observer.waitForFirstContentfulPaintEvent());
+        Assert.assertTrue(
+                "Load event start event should be reported", observer.waitForLoadEventStartEvent());
+    }
+
     private static class PageLoadMetricsObserver implements PageLoadMetrics.Observer {
+        private static final long NO_NAVIGATION_ID = -1;
+
         private final Tab mTab;
         private final CountDownLatch mFirstContentfulPaintLatch = new CountDownLatch(1);
         private final CountDownLatch mLoadEventStartLatch = new CountDownLatch(1);
+        private long mNavigationId = NO_NAVIGATION_ID;
 
         public PageLoadMetricsObserver(Tab tab) {
             mTab = tab;
         }
 
         @Override
-        public void onFirstContentfulPaint(
-                WebContents webContents, long navigationStartTick, long firstContentfulPaintMs) {
-            if (webContents != mTab.getWebContents()) return;
+        public void onNewNavigation(WebContents webContents, long navigationId) {
+            if (mNavigationId == NO_NAVIGATION_ID) mNavigationId = navigationId;
+        }
+
+        @Override
+        public void onFirstContentfulPaint(WebContents webContents, long navigationId,
+                long navigationStartTick, long firstContentfulPaintMs) {
+            if (webContents != mTab.getWebContents() || navigationId != mNavigationId) return;
 
             if (firstContentfulPaintMs > 0) mFirstContentfulPaintLatch.countDown();
         }
 
         @Override
-        public void onLoadEventStart(
-                WebContents webContents, long navigationStartTick, long loadEventStartMs) {
-            if (webContents != mTab.getWebContents()) return;
+        public void onLoadEventStart(WebContents webContents, long navigationId,
+                long navigationStartTick, long loadEventStartMs) {
+            if (webContents != mTab.getWebContents() || navigationId != mNavigationId) return;
 
             if (loadEventStartMs > 0) mLoadEventStartLatch.countDown();
         }
@@ -104,14 +118,18 @@
             return mLoadEventStartLatch.await(PAGE_LOAD_METRICS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
         }
 
-        @Override
-        public void onLoadedMainResource(WebContents webContents, long dnsStartMs, long dnsEndMs,
-                long connectStartMs, long connectEndMs, long requestStartMs, long sendStartMs,
-                long sendEndMs) {}
+        public long getNavigationId() {
+            return mNavigationId;
+        }
 
         @Override
-        public void onNetworkQualityEstimate(WebContents webContents, int effectiveConnectionType,
-                long httpRttMs, long transportRttMs) {}
+        public void onLoadedMainResource(WebContents webContents, long navigationId,
+                long dnsStartMs, long dnsEndMs, long connectStartMs, long connectEndMs,
+                long requestStartMs, long sendStartMs, long sendEndMs) {}
+
+        @Override
+        public void onNetworkQualityEstimate(WebContents webContents, long navigationId,
+                int effectiveConnectionType, long httpRttMs, long transportRttMs) {}
     }
 
     @Test
@@ -119,18 +137,31 @@
     public void testPageLoadMetricEmitted() throws InterruptedException {
         Assert.assertFalse("Tab shouldn't be loading anything before we add observer",
                 mActivityTestRule.getActivity().getActivityTab().isLoading());
-        ThreadUtils.runOnUiThreadBlocking(new Runnable() {
-            @Override
-            public void run() {
-                PageLoadMetrics.addObserver(mMetricsObserver);
-            }
-        });
+        ThreadUtils.runOnUiThreadBlocking(
+                (Runnable) () -> PageLoadMetrics.addObserver(mMetricsObserver));
 
         mActivityTestRule.loadUrl(mTestPage);
+        assertMetricsEmitted(mMetricsObserver);
+    }
 
-        Assert.assertTrue("First Contentful Paint should be reported",
-                mMetricsObserver.waitForFirstContentfulPaintEvent());
-        Assert.assertTrue("Load event start event should be reported",
-                mMetricsObserver.waitForLoadEventStartEvent());
+    @Test
+    @SmallTest
+    public void testPageLoadMetricNavigationIdSetCorrectly() throws InterruptedException {
+        ThreadUtils.runOnUiThreadBlocking(
+                (Runnable) () -> PageLoadMetrics.addObserver(mMetricsObserver));
+        mActivityTestRule.loadUrl(mTestPage);
+        assertMetricsEmitted(mMetricsObserver);
+
+        PageLoadMetricsObserver metricsObserver2 =
+                new PageLoadMetricsObserver(mActivityTestRule.getActivity().getActivityTab());
+        ThreadUtils.runOnUiThreadBlocking(
+                (Runnable) () -> PageLoadMetrics.addObserver(metricsObserver2));
+        mActivityTestRule.loadUrl(mTestPage2);
+        assertMetricsEmitted(metricsObserver2);
+
+        Assert.assertNotEquals("Subsequent navigations should have different navigation ids",
+                mMetricsObserver.getNavigationId(), metricsObserver2.getNavigationId());
+        ThreadUtils.runOnUiThreadBlocking(
+                (Runnable) () -> PageLoadMetrics.removeObserver(metricsObserver2));
     }
 }
diff --git a/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.cc
index a486cbed..05d3352 100644
--- a/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.cc
+++ b/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.cc
@@ -24,9 +24,10 @@
     : web_contents_(web_contents) {
   Profile* profile =
       Profile::FromBrowserContext(web_contents->GetBrowserContext());
-  if (profile)
+  if (profile) {
     network_quality_provider_ =
         UINetworkQualityEstimatorServiceFactory::GetForProfile(profile);
+  }
 }
 
 AndroidPageLoadMetricsObserver::ObservePolicy
@@ -34,6 +35,8 @@
     content::NavigationHandle* navigation_handle,
     const GURL& currently_committed_url,
     bool started_in_foreground) {
+  navigation_id_ = navigation_handle->GetNavigationId();
+  ReportNewNavigation();
   if (network_quality_provider_) {
     int64_t http_rtt =
         network_quality_provider_->GetHttpRTT().has_value()
@@ -107,6 +110,15 @@
   }
 }
 
+void AndroidPageLoadMetricsObserver::ReportNewNavigation() {
+  DCHECK_GE(navigation_id_, 0);
+  base::android::ScopedJavaLocalRef<jobject> java_web_contents =
+      web_contents_->GetJavaWebContents();
+  JNIEnv* env = base::android::AttachCurrentThread();
+  Java_PageLoadMetrics_onNewNavigation(env, java_web_contents,
+                                       static_cast<jlong>(navigation_id_));
+}
+
 void AndroidPageLoadMetricsObserver::ReportNetworkQualityEstimate(
     net::EffectiveConnectionType connection_type,
     int64_t http_rtt_ms,
@@ -115,8 +127,9 @@
       web_contents_->GetJavaWebContents();
   JNIEnv* env = base::android::AttachCurrentThread();
   Java_PageLoadMetrics_onNetworkQualityEstimate(
-      env, java_web_contents, static_cast<jint>(connection_type),
-      static_cast<jlong>(http_rtt_ms), static_cast<jlong>(transport_rtt_ms));
+      env, java_web_contents, static_cast<jlong>(navigation_id_),
+      static_cast<jint>(connection_type), static_cast<jlong>(http_rtt_ms),
+      static_cast<jlong>(transport_rtt_ms));
 }
 
 void AndroidPageLoadMetricsObserver::ReportFirstContentfulPaint(
@@ -126,7 +139,8 @@
       web_contents_->GetJavaWebContents();
   JNIEnv* env = base::android::AttachCurrentThread();
   Java_PageLoadMetrics_onFirstContentfulPaint(
-      env, java_web_contents, static_cast<jlong>(navigation_start_tick),
+      env, java_web_contents, static_cast<jlong>(navigation_id_),
+      static_cast<jlong>(navigation_start_tick),
       static_cast<jlong>(first_contentful_paint_ms));
 }
 
@@ -137,7 +151,8 @@
       web_contents_->GetJavaWebContents();
   JNIEnv* env = base::android::AttachCurrentThread();
   Java_PageLoadMetrics_onLoadEventStart(
-      env, java_web_contents, static_cast<jlong>(navigation_start_tick),
+      env, java_web_contents, static_cast<jlong>(navigation_id_),
+      static_cast<jlong>(navigation_start_tick),
       static_cast<jlong>(load_event_start_ms));
 }
 
@@ -153,8 +168,9 @@
       web_contents_->GetJavaWebContents();
   JNIEnv* env = base::android::AttachCurrentThread();
   Java_PageLoadMetrics_onLoadedMainResource(
-      env, java_web_contents, static_cast<jlong>(dns_start_ms),
-      static_cast<jlong>(dns_end_ms), static_cast<jlong>(connect_start_ms),
-      static_cast<jlong>(connect_end_ms), static_cast<jlong>(request_start_ms),
-      static_cast<jlong>(send_start_ms), static_cast<jlong>(send_end_ms));
+      env, java_web_contents, static_cast<jlong>(navigation_id_),
+      static_cast<jlong>(dns_start_ms), static_cast<jlong>(dns_end_ms),
+      static_cast<jlong>(connect_start_ms), static_cast<jlong>(connect_end_ms),
+      static_cast<jlong>(request_start_ms), static_cast<jlong>(send_start_ms),
+      static_cast<jlong>(send_end_ms));
 }
diff --git a/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.h
index 336a1755..439e6208 100644
--- a/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.h
+++ b/chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.h
@@ -44,6 +44,8 @@
       : web_contents_(web_contents),
         network_quality_provider_(network_quality_provider) {}
 
+  virtual void ReportNewNavigation();
+
   virtual void ReportNetworkQualityEstimate(
       net::EffectiveConnectionType connection_type,
       int64_t http_rtt_ms,
@@ -67,6 +69,7 @@
   content::WebContents* web_contents_;
 
   bool did_dispatch_on_main_resource_ = false;
+  int64_t navigation_id_ = -1;
 
   net::NetworkQualityEstimator::NetworkQualityProvider*
       network_quality_provider_ = nullptr;
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
index 243e3762..f207fda3 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
@@ -552,6 +552,10 @@
 #if defined(OS_LINUX) || defined(OS_CHROMEOS)
 #define MAYBE_MouseLockSilentAfterTargetUnlock \
   DISABLED_MouseLockSilentAfterTargetUnlock
+#elif defined(OS_WIN)
+// Flaky on Windows; see https://crbug.com/791539.
+#define MAYBE_MouseLockSilentAfterTargetUnlock \
+  DISABLED_MouseLockSilentAfterTargetUnlock
 #else
 #define MAYBE_MouseLockSilentAfterTargetUnlock MouseLockSilentAfterTargetUnlock
 #endif
diff --git a/components/viz/service/main/viz_main_impl.cc b/components/viz/service/main/viz_main_impl.cc
index efa73c7..49375fa 100644
--- a/components/viz/service/main/viz_main_impl.cc
+++ b/components/viz/service/main/viz_main_impl.cc
@@ -29,7 +29,7 @@
 #include "services/service_manager/public/cpp/connector.h"
 
 #if defined(OS_CHROMEOS) && BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #endif
 
 namespace {
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index c170ebdf..96dc1274 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -95,7 +95,7 @@
 #endif
 
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #endif
 
 namespace content {
diff --git a/content/shell/browser/shell_permission_manager.cc b/content/shell/browser/shell_permission_manager.cc
index fbfaeab..73c05f7 100644
--- a/content/shell/browser/shell_permission_manager.cc
+++ b/content/shell/browser/shell_permission_manager.cc
@@ -17,7 +17,13 @@
 
 bool IsWhitelistedPermissionType(PermissionType permission) {
   return permission == PermissionType::GEOLOCATION ||
-         permission == PermissionType::MIDI;
+         permission == PermissionType::MIDI ||
+         permission == PermissionType::SENSORS ||
+         // Background sync browser tests require permission to be granted by
+         // default.
+         // TODO(nsatragno): add a command line flag so that it's only granted
+         // for tests.
+         permission == PermissionType::BACKGROUND_SYNC;
 }
 
 }  // namespace
@@ -71,12 +77,6 @@
     PermissionType permission,
     const GURL& requesting_origin,
     const GURL& embedding_origin) {
-  // Background sync browser tests require permission to be granted by default.
-  // TODO(nsatragno): add a command line flag so that it's only granted for
-  // tests.
-  if (permission == PermissionType::BACKGROUND_SYNC)
-    return blink::mojom::PermissionStatus::GRANTED;
-
   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
   if ((permission == PermissionType::AUDIO_CAPTURE ||
        permission == PermissionType::VIDEO_CAPTURE) &&
@@ -85,13 +85,9 @@
     return blink::mojom::PermissionStatus::GRANTED;
   }
 
-  // Generic sensor browser tests require permission to be granted.
-  if (permission == PermissionType::SENSORS &&
-      command_line->HasSwitch(switches::kContentBrowserTest)) {
-    return blink::mojom::PermissionStatus::GRANTED;
-  }
-
-  return blink::mojom::PermissionStatus::DENIED;
+  return IsWhitelistedPermissionType(permission)
+             ? blink::mojom::PermissionStatus::GRANTED
+             : blink::mojom::PermissionStatus::DENIED;
 }
 
 int ShellPermissionManager::SubscribePermissionStatusChange(
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
index ef3e29b6..dae02ba 100644
--- a/media/gpu/BUILD.gn
+++ b/media/gpu/BUILD.gn
@@ -310,26 +310,26 @@
 
   if (use_vaapi) {
     sources += [
-                 "va_surface.cc",
-                 "va_surface.h",
-                 "vaapi/vaapi_picture_factory.cc",
-                 "vaapi/vaapi_picture_factory.h",
+                 "vaapi/va_surface.cc",
+                 "vaapi/va_surface.h",
+                 "vaapi/vaapi_jpeg_decode_accelerator.cc",
+                 "vaapi/vaapi_jpeg_decode_accelerator.h",
+                 "vaapi/vaapi_jpeg_decoder.cc",
+                 "vaapi/vaapi_jpeg_decoder.h",
+                 "vaapi/vaapi_jpeg_encode_accelerator.cc",
+                 "vaapi/vaapi_jpeg_encode_accelerator.h",
+                 "vaapi/vaapi_jpeg_encoder.cc",
+                 "vaapi/vaapi_jpeg_encoder.h",
                  "vaapi/vaapi_picture.cc",
                  "vaapi/vaapi_picture.h",
-                 "vaapi_jpeg_decode_accelerator.cc",
-                 "vaapi_jpeg_decode_accelerator.h",
-                 "vaapi_jpeg_decoder.cc",
-                 "vaapi_jpeg_decoder.h",
-                 "vaapi_jpeg_encode_accelerator.cc",
-                 "vaapi_jpeg_encode_accelerator.h",
-                 "vaapi_jpeg_encoder.cc",
-                 "vaapi_jpeg_encoder.h",
-                 "vaapi_video_decode_accelerator.cc",
-                 "vaapi_video_decode_accelerator.h",
-                 "vaapi_video_encode_accelerator.cc",
-                 "vaapi_video_encode_accelerator.h",
-                 "vaapi_wrapper.cc",
-                 "vaapi_wrapper.h",
+                 "vaapi/vaapi_picture_factory.cc",
+                 "vaapi/vaapi_picture_factory.h",
+                 "vaapi/vaapi_video_decode_accelerator.cc",
+                 "vaapi/vaapi_video_decode_accelerator.h",
+                 "vaapi/vaapi_video_encode_accelerator.cc",
+                 "vaapi/vaapi_video_encode_accelerator.h",
+                 "vaapi/vaapi_wrapper.cc",
+                 "vaapi/vaapi_wrapper.h",
                ] + get_target_outputs(":libva_generate_stubs")
     configs += [ "//third_party/libyuv:libyuv_config" ]
     deps += [
@@ -596,7 +596,7 @@
   ]
 
   if (use_vaapi) {
-    sources += [ "vaapi_video_decode_accelerator_unittest.cc" ]
+    sources += [ "vaapi/vaapi_video_decode_accelerator_unittest.cc" ]
     deps += [
       ":gpu",
       "//base/test:test_support",
diff --git a/media/gpu/gpu_jpeg_decode_accelerator_factory.cc b/media/gpu/gpu_jpeg_decode_accelerator_factory.cc
index adf725b..9acb9c7 100644
--- a/media/gpu/gpu_jpeg_decode_accelerator_factory.cc
+++ b/media/gpu/gpu_jpeg_decode_accelerator_factory.cc
@@ -17,7 +17,7 @@
 #endif
 
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_jpeg_decode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h"
 #endif
 
 #if defined(USE_V4L2_JDA)
diff --git a/media/gpu/gpu_video_decode_accelerator_factory.cc b/media/gpu/gpu_video_decode_accelerator_factory.cc
index 378cd052..f40347a 100644
--- a/media/gpu/gpu_video_decode_accelerator_factory.cc
+++ b/media/gpu/gpu_video_decode_accelerator_factory.cc
@@ -34,7 +34,7 @@
 #include "media/gpu/android/device_info.h"
 #endif
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_video_decode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_video_decode_accelerator.h"
 #include "ui/gl/gl_implementation.h"
 #endif
 
diff --git a/media/gpu/gpu_video_encode_accelerator_factory.cc b/media/gpu/gpu_video_encode_accelerator_factory.cc
index 2082d0f..283f0e2 100644
--- a/media/gpu/gpu_video_encode_accelerator_factory.cc
+++ b/media/gpu/gpu_video_encode_accelerator_factory.cc
@@ -24,7 +24,7 @@
 #include "media/gpu/media_foundation_video_encode_accelerator_win.h"
 #endif
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_video_encode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_video_encode_accelerator.h"
 #endif
 
 namespace media {
diff --git a/media/gpu/jpeg_decode_accelerator_unittest.cc b/media/gpu/jpeg_decode_accelerator_unittest.cc
index 66d89eb..4fe70a3 100644
--- a/media/gpu/jpeg_decode_accelerator_unittest.cc
+++ b/media/gpu/jpeg_decode_accelerator_unittest.cc
@@ -35,7 +35,7 @@
 #include "ui/gfx/codec/jpeg_codec.h"
 
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #endif
 
 namespace media {
diff --git a/media/gpu/va_surface.cc b/media/gpu/vaapi/va_surface.cc
similarity index 93%
rename from media/gpu/va_surface.cc
rename to media/gpu/vaapi/va_surface.cc
index a1f3a84..61338ab 100644
--- a/media/gpu/va_surface.cc
+++ b/media/gpu/vaapi/va_surface.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/va_surface.h"
+#include "media/gpu/vaapi/va_surface.h"
 
 namespace media {
 
diff --git a/media/gpu/va_surface.h b/media/gpu/vaapi/va_surface.h
similarity index 97%
rename from media/gpu/va_surface.h
rename to media/gpu/vaapi/va_surface.h
index 3734345..a68db2d7 100644
--- a/media/gpu/va_surface.h
+++ b/media/gpu/vaapi/va_surface.h
@@ -5,8 +5,8 @@
 // This file contains the definition of VASurface class, used for decoding by
 // VaapiVideoDecodeAccelerator and VaapiH264Decoder.
 
-#ifndef MEDIA_GPU_VA_SURFACE_H_
-#define MEDIA_GPU_VA_SURFACE_H_
+#ifndef MEDIA_GPU_VAAPI_VA_SURFACE_H_
+#define MEDIA_GPU_VAAPI_VA_SURFACE_H_
 
 #include <va/va.h>
 
@@ -114,4 +114,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VA_SURFACE_H_
+#endif  // MEDIA_GPU_VAAPI_VA_SURFACE_H_
diff --git a/media/gpu/vaapi/vaapi_drm_picture.cc b/media/gpu/vaapi/vaapi_drm_picture.cc
index 10876fc..b326efd 100644
--- a/media/gpu/vaapi/vaapi_drm_picture.cc
+++ b/media/gpu/vaapi/vaapi_drm_picture.cc
@@ -5,8 +5,8 @@
 #include "media/gpu/vaapi/vaapi_drm_picture.h"
 
 #include "base/file_descriptor_posix.h"
-#include "media/gpu/va_surface.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/va_surface.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "ui/gfx/gpu_memory_buffer.h"
 #include "ui/gfx/native_pixmap.h"
 #include "ui/gl/gl_bindings.h"
diff --git a/media/gpu/vaapi_jpeg_decode_accelerator.cc b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc
similarity index 99%
rename from media/gpu/vaapi_jpeg_decode_accelerator.cc
rename to media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc
index 23725ba..017c08a 100644
--- a/media/gpu/vaapi_jpeg_decode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_jpeg_decode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h"
 
 #include <stddef.h>
 #include <string.h>
diff --git a/media/gpu/vaapi_jpeg_decode_accelerator.h b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h
similarity index 94%
rename from media/gpu/vaapi_jpeg_decode_accelerator.h
rename to media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h
index 4c00047..3a6b860 100644
--- a/media/gpu/vaapi_jpeg_decode_accelerator.h
+++ b/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MEDIA_GPU_VAAPI_JPEG_DECODE_ACCELERATOR_H_
-#define MEDIA_GPU_VAAPI_JPEG_DECODE_ACCELERATOR_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODE_ACCELERATOR_H_
+#define MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODE_ACCELERATOR_H_
 
 #include <stdint.h>
 
@@ -18,8 +18,8 @@
 #include "media/base/bitstream_buffer.h"
 #include "media/gpu/media_gpu_export.h"
 #include "media/gpu/shared_memory_region.h"
-#include "media/gpu/vaapi_jpeg_decoder.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_jpeg_decoder.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "media/video/jpeg_decode_accelerator.h"
 
 namespace media {
@@ -118,4 +118,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_JPEG_DECODE_ACCELERATOR_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODE_ACCELERATOR_H_
diff --git a/media/gpu/vaapi_jpeg_decoder.cc b/media/gpu/vaapi/vaapi_jpeg_decoder.cc
similarity index 99%
rename from media/gpu/vaapi_jpeg_decoder.cc
rename to media/gpu/vaapi/vaapi_jpeg_decoder.cc
index bc46fba6..45b62d69 100644
--- a/media/gpu/vaapi_jpeg_decoder.cc
+++ b/media/gpu/vaapi/vaapi_jpeg_decoder.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_jpeg_decoder.h"
+#include "media/gpu/vaapi/vaapi_jpeg_decoder.h"
 
 #include <stddef.h>
 #include <string.h>
diff --git a/media/gpu/vaapi_jpeg_decoder.h b/media/gpu/vaapi/vaapi_jpeg_decoder.h
similarity index 88%
rename from media/gpu/vaapi_jpeg_decoder.h
rename to media/gpu/vaapi/vaapi_jpeg_decoder.h
index 77865b6..705229a6 100644
--- a/media/gpu/vaapi_jpeg_decoder.h
+++ b/media/gpu/vaapi/vaapi_jpeg_decoder.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MEDIA_GPU_VAAPI_JPEG_DECODER_H_
-#define MEDIA_GPU_VAAPI_JPEG_DECODER_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODER_H_
+#define MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODER_H_
 
 #include "base/macros.h"
 #include "media/gpu/media_gpu_export.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 
 namespace media {
 
@@ -40,4 +40,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_JPEG_DECODER_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_JPEG_DECODER_H_
diff --git a/media/gpu/vaapi_jpeg_decoder_unittest.cc b/media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc
similarity index 98%
rename from media/gpu/vaapi_jpeg_decoder_unittest.cc
rename to media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc
index 44ba749..411b925 100644
--- a/media/gpu/vaapi_jpeg_decoder_unittest.cc
+++ b/media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc
@@ -21,7 +21,7 @@
 #include "media/base/test_data_util.h"
 #include "media/base/video_frame.h"
 #include "media/filters/jpeg_parser.h"
-#include "media/gpu/vaapi_jpeg_decoder.h"
+#include "media/gpu/vaapi/vaapi_jpeg_decoder.h"
 
 namespace media {
 namespace {
diff --git a/media/gpu/vaapi_jpeg_encode_accelerator.cc b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc
similarity index 98%
rename from media/gpu/vaapi_jpeg_encode_accelerator.cc
rename to media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc
index d7b0428..6c28b5a 100644
--- a/media/gpu/vaapi_jpeg_encode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_jpeg_encode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h"
 
 #include <stddef.h>
 
@@ -18,7 +18,7 @@
 #include "base/trace_event/trace_event.h"
 #include "media/base/bind_to_current_loop.h"
 #include "media/base/video_frame.h"
-#include "media/gpu/vaapi_jpeg_encoder.h"
+#include "media/gpu/vaapi/vaapi_jpeg_encoder.h"
 
 namespace media {
 
diff --git a/media/gpu/vaapi_jpeg_encode_accelerator.h b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h
similarity index 93%
rename from media/gpu/vaapi_jpeg_encode_accelerator.h
rename to media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h
index afcd1803..4610bbf 100644
--- a/media/gpu/vaapi_jpeg_encode_accelerator.h
+++ b/media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MEDIA_GPU_VAAPI_JPEG_ENCODE_ACCELERATOR_H_
-#define MEDIA_GPU_VAAPI_JPEG_ENCODE_ACCELERATOR_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_JPEG_ENCODE_ACCELERATOR_H_
+#define MEDIA_GPU_VAAPI_VAAPI_JPEG_ENCODE_ACCELERATOR_H_
 
 #include <memory>
 
@@ -13,7 +13,7 @@
 #include "media/base/bitstream_buffer.h"
 #include "media/gpu/media_gpu_export.h"
 #include "media/gpu/shared_memory_region.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "media/video/jpeg_encode_accelerator.h"
 
 namespace media {
@@ -93,4 +93,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_JPEG_ENCODE_ACCELERATOR_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_JPEG_ENCODE_ACCELERATOR_H_
diff --git a/media/gpu/vaapi_jpeg_encoder.cc b/media/gpu/vaapi/vaapi_jpeg_encoder.cc
similarity index 99%
rename from media/gpu/vaapi_jpeg_encoder.cc
rename to media/gpu/vaapi/vaapi_jpeg_encoder.cc
index 5615b2b..f6fe83f 100644
--- a/media/gpu/vaapi_jpeg_encoder.cc
+++ b/media/gpu/vaapi/vaapi_jpeg_encoder.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_jpeg_encoder.h"
+#include "media/gpu/vaapi/vaapi_jpeg_encoder.h"
 
 #include <stddef.h>
 #include <string.h>
@@ -12,7 +12,7 @@
 #include "base/macros.h"
 #include "base/numerics/safe_conversions.h"
 #include "media/filters/jpeg_parser.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 
 #define ARRAY_MEMCPY_CHECKED(to, from)                               \
   do {                                                               \
diff --git a/media/gpu/vaapi_jpeg_encoder.h b/media/gpu/vaapi/vaapi_jpeg_encoder.h
similarity index 93%
rename from media/gpu/vaapi_jpeg_encoder.h
rename to media/gpu/vaapi/vaapi_jpeg_encoder.h
index 79eab91..bf3294f72 100644
--- a/media/gpu/vaapi_jpeg_encoder.h
+++ b/media/gpu/vaapi/vaapi_jpeg_encoder.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MEDIA_GPU_VAAPI_JPEG_ENCODER_H_
-#define MEDIA_GPU_VAAPI_JPEG_ENCODER_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_JPEG_ENCODER_H_
+#define MEDIA_GPU_VAAPI_VAAPI_JPEG_ENCODER_H_
 
 #include <va/va.h>
 #include <memory>
@@ -62,4 +62,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_JPEG_ENCODER_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_JPEG_ENCODER_H_
diff --git a/media/gpu/vaapi/vaapi_picture.cc b/media/gpu/vaapi/vaapi_picture.cc
index 313e9c3..e7af66c3 100644
--- a/media/gpu/vaapi/vaapi_picture.cc
+++ b/media/gpu/vaapi/vaapi_picture.cc
@@ -4,7 +4,7 @@
 
 #include "media/gpu/vaapi/vaapi_picture.h"
 
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "ui/gl/gl_bindings.h"
 #include "ui/gl/gl_implementation.h"
 
diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
index 9a0e20b..4501955e 100644
--- a/media/gpu/vaapi/vaapi_picture_factory.cc
+++ b/media/gpu/vaapi/vaapi_picture_factory.cc
@@ -4,7 +4,7 @@
 
 #include "media/gpu/vaapi/vaapi_picture_factory.h"
 
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "ui/gl/gl_bindings.h"
 
 #include "media/gpu/vaapi/vaapi_drm_picture.h"
diff --git a/media/gpu/vaapi/vaapi_tfp_picture.cc b/media/gpu/vaapi/vaapi_tfp_picture.cc
index 4ff8e28c..e9eecce 100644
--- a/media/gpu/vaapi/vaapi_tfp_picture.cc
+++ b/media/gpu/vaapi/vaapi_tfp_picture.cc
@@ -4,8 +4,8 @@
 
 #include "media/gpu/vaapi/vaapi_tfp_picture.h"
 
-#include "media/gpu/va_surface.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/va_surface.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "ui/gfx/x/x11_types.h"
 #include "ui/gl/gl_bindings.h"
 #include "ui/gl/gl_image_glx.h"
diff --git a/media/gpu/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
similarity index 99%
rename from media/gpu/vaapi_video_decode_accelerator.cc
rename to media/gpu/vaapi/vaapi_video_decode_accelerator.cc
index 76c2f0f..18bfb8ed 100644
--- a/media/gpu/vaapi_video_decode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_video_decode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_video_decode_accelerator.h"
 
 #include <string.h>
 
diff --git a/media/gpu/vaapi_video_decode_accelerator.h b/media/gpu/vaapi/vaapi_video_decode_accelerator.h
similarity index 97%
rename from media/gpu/vaapi_video_decode_accelerator.h
rename to media/gpu/vaapi/vaapi_video_decode_accelerator.h
index 00ddaba..b556b17 100644
--- a/media/gpu/vaapi_video_decode_accelerator.h
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.h
@@ -5,8 +5,8 @@
 // This file contains an implementation of VideoDecoderAccelerator
 // that utilizes hardware video decoder present on Intel CPUs.
 
-#ifndef MEDIA_GPU_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
-#define MEDIA_GPU_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
+#define MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
 
 #include <stddef.h>
 #include <stdint.h>
@@ -32,7 +32,7 @@
 #include "media/gpu/media_gpu_export.h"
 #include "media/gpu/shared_memory_region.h"
 #include "media/gpu/vaapi/vaapi_picture_factory.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "media/video/picture.h"
 #include "media/video/video_decode_accelerator.h"
 
@@ -322,4 +322,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODE_ACCELERATOR_H_
diff --git a/media/gpu/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
similarity index 98%
rename from media/gpu/vaapi_video_decode_accelerator_unittest.cc
rename to media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
index 34d429aa..ef10236d 100644
--- a/media/gpu/vaapi_video_decode_accelerator_unittest.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_video_decode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_video_decode_accelerator.h"
 
 #include "base/bind.h"
 #include "base/memory/ptr_util.h"
@@ -12,7 +12,7 @@
 #include "media/gpu/format_utils.h"
 #include "media/gpu/vaapi/vaapi_picture.h"
 #include "media/gpu/vaapi/vaapi_picture_factory.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/media/gpu/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
similarity index 99%
rename from media/gpu/vaapi_video_encode_accelerator.cc
rename to media/gpu/vaapi/vaapi_video_encode_accelerator.cc
index 6ae28fbb..f602340e 100644
--- a/media/gpu/vaapi_video_encode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_video_encode_accelerator.h"
+#include "media/gpu/vaapi/vaapi_video_encode_accelerator.h"
 
 #include <string.h>
 
diff --git a/media/gpu/vaapi_video_encode_accelerator.h b/media/gpu/vaapi/vaapi_video_encode_accelerator.h
similarity index 97%
rename from media/gpu/vaapi_video_encode_accelerator.h
rename to media/gpu/vaapi/vaapi_video_encode_accelerator.h
index 5b9de15..7912f21 100644
--- a/media/gpu/vaapi_video_encode_accelerator.h
+++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MEDIA_GPU_VAAPI_VIDEO_ENCODE_ACCELERATOR_H_
-#define MEDIA_GPU_VAAPI_VIDEO_ENCODE_ACCELERATOR_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_VIDEO_ENCODE_ACCELERATOR_H_
+#define MEDIA_GPU_VAAPI_VAAPI_VIDEO_ENCODE_ACCELERATOR_H_
 
 #include <stddef.h>
 #include <stdint.h>
@@ -18,8 +18,8 @@
 #include "media/filters/h264_bitstream_buffer.h"
 #include "media/gpu/h264_dpb.h"
 #include "media/gpu/media_gpu_export.h"
-#include "media/gpu/va_surface.h"
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/va_surface.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #include "media/video/video_encode_accelerator.h"
 
 namespace media {
@@ -272,4 +272,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_VIDEO_ENCODE_ACCELERATOR_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_VIDEO_ENCODE_ACCELERATOR_H_
diff --git a/media/gpu/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
similarity index 99%
rename from media/gpu/vaapi_wrapper.cc
rename to media/gpu/vaapi/vaapi_wrapper.cc
index 403fbba0..83c5c736 100644
--- a/media/gpu/vaapi_wrapper.cc
+++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 
 #include <dlfcn.h>
 #include <string.h>
diff --git a/media/gpu/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
similarity index 98%
rename from media/gpu/vaapi_wrapper.h
rename to media/gpu/vaapi/vaapi_wrapper.h
index 4560c66..38d4110d 100644
--- a/media/gpu/vaapi_wrapper.h
+++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -7,8 +7,8 @@
 // and VaapiVideoEncodeAccelerator for encode, to interface
 // with libva (VA-API library for hardware video codec).
 
-#ifndef MEDIA_GPU_VAAPI_WRAPPER_H_
-#define MEDIA_GPU_VAAPI_WRAPPER_H_
+#ifndef MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_
+#define MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_
 
 #include <stddef.h>
 #include <stdint.h>
@@ -25,7 +25,7 @@
 #include "media/base/video_decoder_config.h"
 #include "media/base/video_frame.h"
 #include "media/gpu/media_gpu_export.h"
-#include "media/gpu/va_surface.h"
+#include "media/gpu/vaapi/va_surface.h"
 #include "media/video/jpeg_decode_accelerator.h"
 #include "media/video/video_decode_accelerator.h"
 #include "media/video/video_encode_accelerator.h"
@@ -285,4 +285,4 @@
 
 }  // namespace media
 
-#endif  // MEDIA_GPU_VAAPI_WRAPPER_H_
+#endif  // MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_
diff --git a/media/gpu/video_decode_accelerator_unittest.cc b/media/gpu/video_decode_accelerator_unittest.cc
index a4db55a..cb85b791 100644
--- a/media/gpu/video_decode_accelerator_unittest.cc
+++ b/media/gpu/video_decode_accelerator_unittest.cc
@@ -75,7 +75,7 @@
 #include "media/gpu/dxva_video_decode_accelerator_win.h"
 #endif  // defined(OS_WIN)
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #endif  // BUILDFLAG(USE_VAAPI)
 
 #if defined(OS_CHROMEOS)
diff --git a/media/gpu/video_encode_accelerator_unittest.cc b/media/gpu/video_encode_accelerator_unittest.cc
index 8813fbc..4278564 100644
--- a/media/gpu/video_encode_accelerator_unittest.cc
+++ b/media/gpu/video_encode_accelerator_unittest.cc
@@ -56,7 +56,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 #if BUILDFLAG(USE_VAAPI)
-#include "media/gpu/vaapi_wrapper.h"
+#include "media/gpu/vaapi/vaapi_wrapper.h"
 #elif defined(OS_WIN)
 #include "media/gpu/media_foundation_video_encode_accelerator_win.h"
 #endif
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 89cce0d..8b35a4d 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1862,13 +1862,11 @@
 crbug.com/704259 external/wpt/content-security-policy/reporting/reporting-api-sends-reports-on-violation.https.sub.html [ Skip ]
 
 # These HTTP tests that started failing after a web-platform-tests import.
-crbug.com/711529 http/tests/notifications/serviceworker-notification-event.html [ Timeout ]
 crbug.com/711529 http/tests/origin_trials/sample-api-workers.html [ Crash Timeout ]
 crbug.com/711529 http/tests/permissions/test-api-surface.html [ Timeout ]
 crbug.com/711529 http/tests/permissions/test-query.html [ Timeout ]
 crbug.com/711529 http/tests/security/cross-origin-createImageBitmap-structured-clone.html [ Timeout ]
 crbug.com/711529 http/tests/workers/shared-worker-performance-timeline.html [ Timeout ]
-crbug.com/711529 virtual/mojo-notifications/http/tests/notifications/serviceworker-notification-event.html [ Timeout ]
 
 crbug.com/713587 external/wpt/css/css-ui/caret-color-006.html [ Skip ]
 
diff --git a/third_party/WebKit/LayoutTests/W3CImportExpectations b/third_party/WebKit/LayoutTests/W3CImportExpectations
index d21f9c42..da1e9b54 100644
--- a/third_party/WebKit/LayoutTests/W3CImportExpectations
+++ b/third_party/WebKit/LayoutTests/W3CImportExpectations
@@ -96,7 +96,6 @@
 external/wpt/css/css-ruby [ Skip ]
 external/wpt/css/css-speech [ Skip ]
 external/wpt/css/css-style-attr [ Skip ]
-external/wpt/css/css-syntax [ Skip ]
 external/wpt/css/css-text/hanging-punctuation [ Skip ]
 external/wpt/css/css-text/line-breaking [ Skip ]
 external/wpt/css/css-text/support [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
index 8dd9ee5..e818a19b 100644
--- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
+++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -148490,7 +148490,7 @@
      {}
     ]
    ],
-   "webrtc/RTCRtpSender-getStats-expected.txt": [
+   "webrtc/RTCRtpSender-getStats.https-expected.txt": [
     [
      {}
     ]
@@ -151595,6 +151595,16 @@
      {}
     ]
    ],
+   "worklets/resources/empty-worklet-script-with-cors-header.js": [
+    [
+     {}
+    ]
+   ],
+   "worklets/resources/empty-worklet-script-with-cors-header.js.headers": [
+    [
+     {}
+    ]
+   ],
    "worklets/resources/empty-worklet-script.js": [
     [
      {}
@@ -151605,7 +151615,12 @@
      {}
     ]
    ],
-   "worklets/resources/import-empty-worklet-script.js": [
+   "worklets/resources/import-empty-worklet-script-with-cors-header.js": [
+    [
+     {}
+    ]
+   ],
+   "worklets/resources/import-empty-worklet-script-with-cors-header.js.headers": [
     [
      {}
     ]
@@ -213171,9 +213186,9 @@
      {}
     ]
    ],
-   "webrtc/RTCRtpSender-getStats.html": [
+   "webrtc/RTCRtpSender-getStats.https.html": [
     [
-     "/webrtc/RTCRtpSender-getStats.html",
+     "/webrtc/RTCRtpSender-getStats.https.html",
      {}
     ]
    ],
@@ -343653,11 +343668,11 @@
    "testharness"
   ],
   "webrtc/RTCPeerConnection-getStats.https-expected.txt": [
-   "09712d42e8256b83b1ea6799ad3ce5d5f3f8db58",
+   "f5823ddd498e15937e1e7990a5512ad2631a62e8",
    "support"
   ],
   "webrtc/RTCPeerConnection-getStats.https.html": [
-   "1fc0c03ebd989d77c9d721b027a12a0cbbf24d53",
+   "7f1af1fdd06dc20a004ef8adbd09a0dcae66ef64",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-getTransceivers-expected.txt": [
@@ -343936,12 +343951,12 @@
    "27f083617973770f0d42efb93813f0112fc68ad2",
    "testharness"
   ],
-  "webrtc/RTCRtpSender-getStats-expected.txt": [
-   "33a4eae3594e766da3bdf10a6a7f3cac8496d368",
+  "webrtc/RTCRtpSender-getStats.https-expected.txt": [
+   "e733e39c0724de346015e88154c1080760e2ba88",
    "support"
   ],
-  "webrtc/RTCRtpSender-getStats.html": [
-   "9a95fe0a2bd44fda187b586303a95dd5eb7db0cf",
+  "webrtc/RTCRtpSender-getStats.https.html": [
+   "5c480c0d64de4e3ee041b95e5ccaec6264b878b8",
    "testharness"
   ],
   "webrtc/RTCRtpSender-replaceTrack-expected.txt": [
@@ -343985,7 +344000,7 @@
    "testharness"
   ],
   "webrtc/RTCStats-helper.js": [
-   "5ce2ac87b9e9fa6c0d384dcd882787f39a079f47",
+   "19e65b4d27bc350a6678409dc1194085fa93ae2a",
    "support"
   ],
   "webrtc/RTCTrackEvent-constructor-expected.txt": [
@@ -349461,7 +349476,15 @@
    "support"
   ],
   "worklets/resources/csp-tests.js": [
-   "160eff495b94f445098a2764b94841e557b0bc47",
+   "f56d5ced4719b28e4f4815a1f6768b3d60cbebe1",
+   "support"
+  ],
+  "worklets/resources/empty-worklet-script-with-cors-header.js": [
+   "4b78be9f257ad243eb6ca72f84084081267c46a1",
+   "support"
+  ],
+  "worklets/resources/empty-worklet-script-with-cors-header.js.headers": [
+   "90d51a5e46cc58404dd5ec1e9e4e10934a6c0707",
    "support"
   ],
   "worklets/resources/empty-worklet-script.js": [
@@ -349472,8 +349495,12 @@
    "f32abb012c93bb69087688f31a0c243d9e6d1060",
    "support"
   ],
-  "worklets/resources/import-empty-worklet-script.js": [
-   "4add9359940f440fb2c66d17096a45ffbf77975d",
+  "worklets/resources/import-empty-worklet-script-with-cors-header.js": [
+   "f4c82399ef85e69e24a7a1a3b27448e3f3722b70",
+   "support"
+  ],
+  "worklets/resources/import-empty-worklet-script-with-cors-header.js.headers": [
+   "90d51a5e46cc58404dd5ec1e9e4e10934a6c0707",
    "support"
   ],
   "worklets/resources/import-nested-internal-worklet-script.js": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/OWNERS
new file mode 100644
index 0000000..ada3963
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/OWNERS
@@ -0,0 +1,2 @@
+# TEAM: style-dev@chromium.org
+# COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/MANIFEST b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/MANIFEST
new file mode 100644
index 0000000..4bc83f6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/MANIFEST
@@ -0,0 +1,20 @@
+page-utf16-css-bomless-utf16be.html
+page-utf16-css-bomless-utf16.html
+page-utf16-css-no-decl-ascii-only.html
+page-utf16-css-no-decl.html
+page-windows-1251-charset-attribute-bogus.html
+page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html
+page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html
+page-windows-1251-css-at-charset-bogus.html
+page-windows-1251-css-at-charset-utf16-ascii-only.html
+page-windows-1251-css-at-charset-utf16be.html
+page-windows-1251-css-at-charset-utf16.html
+page-windows-1251-css-at-charset-windows-1250-in-utf16be.html
+page-windows-1251-css-at-charset-windows-1250-in-utf16.html
+page-windows-1251-css-http-bogus-at-charset-windows-1250.html
+page-windows-1251-css-http-bogus.html
+page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html
+page-windows-1251-css-no-decl.html
+page-windows-1251-css-utf8-bom.html
+dir support
+xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-bomless-utf16.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-bomless-utf16.html
new file mode 100644
index 0000000..f98bc211
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-bomless-utf16.html
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html
new file mode 100644
index 0000000..1d47283
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html
new file mode 100644
index 0000000..56e09ac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-no-decl.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-no-decl.html
new file mode 100644
index 0000000..2ff52cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-utf16-css-no-decl.html
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt
new file mode 100644
index 0000000..9a655a7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL CSS charset: page windows-1251, charset attribute bogus assert_equals: expected "hidden" but got "visible"
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html
new file mode 100644
index 0000000..939143a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, charset attribute bogus</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/no-decl.css" charset="bogus">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html
new file mode 100644
index 0000000..df51dfa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, @charset windows-1250, charset attribute windows-1253</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-windows-1250.css" charset=windows-1253>
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html
new file mode 100644
index 0000000..7521e85
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset bogus, charset attribute windows-1250</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-bogus.css" charset=windows-1250>
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html
new file mode 100644
index 0000000..2d7c3ef
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, @charset bogus</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-bogus.css">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html
new file mode 100644
index 0000000..d65afd3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset utf-16 (ASCII only)</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-utf16-ascii-only.css">
+<div id=log></div>
+<div id=foo></div>
+<script>
+var elm = document.getElementById('foo');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html
new file mode 100644
index 0000000..04c1270
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset utf-16</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-utf16.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<script>
+var elm = document.getElementById('\ufffd');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html
new file mode 100644
index 0000000..4b2d48dbc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset utf-16be</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-utf16be.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<script>
+var elm = document.getElementById('\ufffd');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html
new file mode 100644
index 0000000..463e377
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset windows-1250 in utf-16</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-windows-1250-in-utf16.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<div id=&#x0418;></div>
+<div id=&#x010c;></div>
+<script>
+var elm_fffd = document.getElementById('\ufffd');
+var elm_0418 = document.getElementById('\u0418');
+var elm_010c = document.getElementById('\u010c');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm_fffd, '').visibility, 'visible', 'selector U+FFFD matched (utf-8)');
+  assert_equals(getComputedStyle(elm_0418, '').visibility, 'hidden', 'selector U+0418 did not match (windows-1251)');
+  assert_equals(getComputedStyle(elm_010c, '').visibility, 'visible', 'selector U+010C matched (windows-1250)');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html
new file mode 100644
index 0000000..7de3f37
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset windows-1250 in utf-16be</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-windows-1250-in-utf16be.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<div id=&#x0418;></div>
+<div id=&#x010c;></div>
+<script>
+var elm_fffd = document.getElementById('\ufffd');
+var elm_0418 = document.getElementById('\u0418');
+var elm_010c = document.getElementById('\u010c');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm_fffd, '').visibility, 'visible', 'selector U+FFFD matched (utf-8)');
+  assert_equals(getComputedStyle(elm_0418, '').visibility, 'hidden', 'selector U+0418 did not match (windows-1251)');
+  assert_equals(getComputedStyle(elm_010c, '').visibility, 'visible', 'selector U+010C matched (windows-1250)');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html
new file mode 100644
index 0000000..2fcc56bc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS HTTP bogus, @charset windows-1250</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/http-bogus-at-charset-windows-1250.bogus.css">
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-bogus.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-bogus.html
new file mode 100644
index 0000000..e26501b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-bogus.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS HTTP bogus</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/http-bogus.bogus.css">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html
new file mode 100644
index 0000000..3658e445
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS HTTP windows-1250, @charset windows-1253</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/http-windows-1250-at-charset-windows-1253.windows1250.css">
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-no-decl.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-no-decl.html
new file mode 100644
index 0000000..288f01e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-no-decl.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS no decl</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/no-decl.css">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html
new file mode 100644
index 0000000..2c32f09
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS UTF-8 BOM</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/utf8-bom.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<script>
+var elm = document.getElementById('\ufffd');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/MANIFEST b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/MANIFEST
new file mode 100644
index 0000000..9688e1f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/MANIFEST
@@ -0,0 +1,15 @@
+support at-charset-bogus.css
+support at-charset-utf16-ascii-only.css
+support at-charset-utf16be.css
+support at-charset-utf16.css
+support at-charset-windows-1250.css
+support at-charset-windows-1250-in-utf16be.css
+support at-charset-windows-1250-in-utf16.css
+support bomless-utf16be.css
+support bomless-utf16.css
+support http-bogus-at-charset-windows-1250.bogus.css
+support http-bogus.bogus.css
+support http-windows-1250-at-charset-windows-1253.windows1250.css
+support no-decl-ascii-only.css
+support no-decl.css
+support utf8-bom.css
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-bogus.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-bogus.css
new file mode 100644
index 0000000..50f9b777
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-bogus.css
@@ -0,0 +1,2 @@
+@charset "bogus";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css
new file mode 100644
index 0000000..e7f067e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css
@@ -0,0 +1,2 @@
+@charset "utf-16";
+#foo { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16.css
new file mode 100644
index 0000000..e7dbf57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16.css
@@ -0,0 +1,2 @@
+@charset "utf-16";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16be.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16be.css
new file mode 100644
index 0000000..cb51b419
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-utf16be.css
@@ -0,0 +1,2 @@
+@charset "utf-16be";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css
new file mode 100644
index 0000000..1132bfd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css
new file mode 100644
index 0000000..38bb069
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250.css
new file mode 100644
index 0000000..6c06db0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/at-charset-windows-1250.css
@@ -0,0 +1,2 @@
+@charset "windows-1250";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/bomless-utf16.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/bomless-utf16.css
new file mode 100644
index 0000000..b5399b7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/bomless-utf16.css
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/bomless-utf16be.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/bomless-utf16be.css
new file mode 100644
index 0000000..eaadad0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/bomless-utf16be.css
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css
new file mode 100644
index 0000000..6c06db0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css
@@ -0,0 +1,2 @@
+@charset "windows-1250";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers
new file mode 100644
index 0000000..f08dbd9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers
@@ -0,0 +1 @@
+Content-Type: text/css; charset=bogus
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus.bogus.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus.bogus.css
new file mode 100644
index 0000000..ba2371f8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus.bogus.css
@@ -0,0 +1 @@
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus.bogus.css.headers b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus.bogus.css.headers
new file mode 100644
index 0000000..f08dbd9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-bogus.bogus.css.headers
@@ -0,0 +1 @@
+Content-Type: text/css; charset=bogus
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css
new file mode 100644
index 0000000..987dff3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css
@@ -0,0 +1,2 @@
+@charset "windows-1253";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers
new file mode 100644
index 0000000..c0993d21
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers
@@ -0,0 +1 @@
+Content-Type: text/css; charset=windows-1250
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/no-decl-ascii-only.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/no-decl-ascii-only.css
new file mode 100644
index 0000000..0736f81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/no-decl-ascii-only.css
@@ -0,0 +1 @@
+#foo { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/no-decl.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/no-decl.css
new file mode 100644
index 0000000..ba2371f8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/no-decl.css
@@ -0,0 +1 @@
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/utf8-bom.css b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/utf8-bom.css
new file mode 100644
index 0000000..1dbf5cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/support/utf8-bom.css
@@ -0,0 +1 @@
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml
new file mode 100644
index 0000000..512df7a0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<?xml-stylesheet href="support/no-decl.css" charset="windows-1250"?>
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<title>CSS charset: page windows-1251, charset attribute bogus</title>
+<link rel="help" href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head><body>
+<div id="log"></div>
+<div id="foo"></div>
+<script>
+var elm = document.getElementById('foo');
+elm.id = '\u010C';
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/ident-three-code-points.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/ident-three-code-points.html
new file mode 100644
index 0000000..36faef9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-syntax/ident-three-code-points.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<title>Testing valid ident based on first three code points</title>
+
+<link rel="author" title="Greg Whitworth" href="gwhit@microsoft.com" />
+<link rel="help" href="https://drafts.csswg.org/css-syntax-3/#would-start-an-identifier" />
+<style>
+    main div {
+      background-color:red;
+    }
+
+    div[name=one],
+    div[name=two] {
+        background: green;
+    }
+
+    #1 {
+      background-color:red;
+    }
+
+    #-2 {
+      background-color:red;
+    }
+
+    #--3 {
+      background-color:green;
+    }
+
+    #---4 {
+      background-color:green;
+    }
+
+    #a {
+      background-color:green;
+    }
+
+    #-b {
+      background-color:green;
+    }
+
+    #--c {
+      background-color:green;
+    }
+
+    #---d {
+      background-color:green;
+    }
+</style>
+<body>
+    <main>
+        <div id="1" class="item" name="one">test1</div>
+        <div id="-2" class="item" name="two">test2</div>
+        <div id="--3" class="item" name="three">test3</div>
+        <div id="---4" class="item" name="four">test4</div>
+
+        <div id="a" class="item" name="five">test A</div>
+        <div id="-b" class="item" name="six">test B</div>
+        <div id="--c" class="item" name="seven">test C</div>
+        <div id="---d" class="item" name="eight">test D</div>
+    </main>
+
+    <script>
+        var items = document.getElementsByClassName('item');
+
+        for(var i=0; i < items.length; i++) {
+            test(function() {
+                assert_equals(window.getComputedStyle(items[i]).getPropertyValue('background-color'), "rgb(0, 128, 0)");
+            }, items[i].getAttribute('name') + " should be green");
+        }
+    </script>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https-expected.txt
index 8b24ef17..45adc35 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https-expected.txt
@@ -9,5 +9,6 @@
 FAIL getStats() with no argument should return stats report containing peer-connection stats assert_equals: Expect dictionary.timeStamp to be number expected "number" but got "undefined"
 FAIL getStats() on track associated with RtpSender should return stats report containing outbound-rtp stats promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'getStats' on 'RTCPeerConnection': The callback provided as parameter 1 is not a function."
 FAIL getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats pc.addTransceiver is not a function
+FAIL getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats assert_unreached: test failed with error: Error: assert_equals: Expect dictionary.timeStamp to be number expected "number" but got "undefined" Reached unreachable code
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https.html b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https.html
index a4df563..decac1b 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCPeerConnection-getStats.https.html
@@ -10,8 +10,8 @@
   'use strict';
 
   // Test is based on the following editor draft:
-  // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html
-  // https://w3c.github.io/webrtc-stats/archives/20170614/webrtc-stats.html
+  // webrtc-pc 20171130
+  // webrtc-stats 20171122
 
   // The following helper function is called from RTCPeerConnection-helper.js
   //   getTrackFromUserMedia
@@ -20,39 +20,25 @@
   //   validateStatsReport
   //   assert_stats_report_has_stats
 
+  // The following helper function is called from RTCPeerConnection-helper.js
+  //   exchangeIceCandidates
+  //   doSignalingHandshake
+
   /*
-    8.2.  RTCPeerConnection Interface Extensions
-      partial interface RTCPeerConnection {
-        Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
-      };
-
-    8.3.  RTCStatsReport Object
-      interface RTCStatsReport {
-        readonly maplike<DOMString, object>;
-      };
-
-    8.4.  RTCStats Dictionary
-      dictionary RTCStats {
-        DOMHighResTimeStamp timestamp;
-        RTCStatsType        type;
-        DOMString           id;
-      };
-
-      id
-        Two RTCStats objects, extracted from two different RTCStatsReport objects, MUST
-        have the same id if they were produced by inspecting the same underlying object.
-
     8.2.  getStats
       1.  Let selectorArg be the method's first argument.
       2.  Let connection be the RTCPeerConnection object on which the method was invoked.
-      3.  If selectorArg is neither null nor a valid MediaStreamTrack, return a promise
-          rejected with a newly created TypeError.
+      3.  If selectorArg is null, let selector be null.
+      4.  If selectorArg is a MediaStreamTrack let selector be an RTCRtpSender
+          or RTCRtpReceiver on connection which track member matches selectorArg.
+          If no such sender or receiver exists, or if more than one sender or
+          receiver fit this criteria, return a promise rejected with a newly
+          created InvalidAccessError.
       5.  Let p be a new promise.
       6.  Run the following steps in parallel:
         1.  Gather the stats indicated by selector according to the stats selection algorithm.
         2.  Resolve p with the resulting RTCStatsReport object, containing the gathered stats.
    */
-
   promise_test(() => {
     const pc = new RTCPeerConnection();
     return pc.getStats();
@@ -65,9 +51,11 @@
 
   /*
     8.2.  getStats
-      4.  Let selector be a RTCRtpSender or RTCRtpReceiver on connection which track
-          member matches selectorArg. If no such sender or receiver exists, return a promise
-          rejected with a newly created InvalidAccessError.
+      4.  If selectorArg is a MediaStreamTrack let selector be an RTCRtpSender
+          or RTCRtpReceiver on connection which track member matches selectorArg.
+          If no such sender or receiver exists, or if more than one sender or
+          receiver fit this criteria, return a promise rejected with a newly
+          created InvalidAccessError.
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
@@ -94,12 +82,6 @@
     return pc.getStats(track);
   }, 'getStats() with track added via addTransceiver should succeed');
 
-  /*
-    8.2.  getStats
-      4.  Let selector be a RTCRtpSender or RTCRtpReceiver on connection which track
-          member matches selectorArg. If more than one sender or receiver fit this criteria,
-          return a promise rejected with a newly created InvalidAccessError.
-   */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     return getTrackFromUserMedia('audio')
@@ -184,4 +166,150 @@
     });
   }, `getStats() on track associated with RtpReceiver should return stats report containing inbound-rtp stats`);
 
+  /*
+    8.6   Mandatory To Implement Stats
+      An implementation MUST support generating statistics of the following types
+      when the corresponding objects exist on a PeerConnection, with the attributes
+      that are listed when they are valid for that object.
+   */
+
+  const mandatoryStats = [
+    "codec",
+    "inbound-rtp",
+    "outbound-rtp",
+    "remote-inbound-rtp",
+    "remote-outbound-rtp",
+    "peer-connection",
+    "data-channel",
+    "stream",
+    "track",
+    "transport",
+    "candidate-pair",
+    "local-candidate",
+    "remote-candidate",
+    "certificate"
+  ];
+
+  async_test(t => {
+    const pc1 = new RTCPeerConnection();
+    t.add_cleanup(() => pc1.close());
+    const pc2 = new RTCPeerConnection();
+    t.add_cleanup(() => pc2.close());
+
+    const dataChannel = pc1.createDataChannel('test-channel');
+
+    return navigator.mediaDevices.getUserMedia({
+      audio: true,
+      video: true
+    })
+    .then(t.step_func(mediaStream => {
+      const tracks = mediaStream.getTracks();
+      assert_equals(tracks.length, 2,
+        'Expect media stream to have one audio and one video track');
+
+      let audioTrack;
+      let videoTrack;
+
+      for (const track of tracks) {
+        t.add_cleanup(() => track.stop());
+
+        pc1.addTrack(track, mediaStream);
+
+        if (track.kind === 'audio') {
+          audioTrack = track;
+        } else if (track.kind === 'video') {
+          videoTrack = track;
+        }
+      }
+
+      if (!audioTrack || ! videoTrack) {
+        assert_unreached('Expect mediaStream to have both audio and video streams');
+      }
+
+      const testStatsReport = (pc, statsReport) => {
+        validateStatsReport(statsReport);
+        assert_stats_report_has_stats(statsReport, mandatoryStats);
+
+        const dataChannelStats = findStatsFromReport(statsReport,
+          stats => {
+            return stats.type === 'data-channel' &&
+              stats.dataChannelIdentifier === dataChannel.id;
+          },
+          'Expect data channel stats to be found');
+
+        assert_equals(dataChannelStats.label, 'test-channel');
+
+        const audioTrackStats = findStatsFromReport(statsReport,
+          stats => {
+            return stats.type === 'track' &&
+              stats.trackIdentifier === audioTrack.id;
+          },
+          'Expect audio track stats to be found');
+
+        assert_equals(audioTrackStats.kind, 'audio');
+
+        const videoTrackStats = findStatsFromReport(statsReport,
+          stats => {
+            return stats.type === 'track' &&
+              stats.trackIdentifier === videoTrack.id;
+          },
+          'Expect video track stats to be found');
+
+        assert_equals(videoTrackStats.kind, 'video');
+
+        const mediaStreamStats = findStatsFromReport(statsReport,
+          stats => {
+            return stats.type === 'stream' &&
+              stats.streamIdentifier === mediaStream.id;
+          },
+          'Expect media stream stats to be found');
+
+        assert_true(mediaStreamStats.trackIds.include(audioTrackStats.id));
+        assert_true(mediaStreamStats.trackIds.include(videoTrackStats.id));
+      }
+
+      const onConnected = t.step_func(() => {
+        // Wait a while for the peer connections to collect stats
+        t.step_timeout(() => {
+          Promise.all([
+            pc1.getStats()
+            .then(statsReport => testStatsReport(pc1, statsReport)),
+
+            pc2.getStats()
+            .then(statsReport => testStatsReport(pc2, statsReport))
+          ])
+          .then(t.step_func_done())
+          .catch(t.step_func(err => {
+            assert_unreached(`test failed with error: ${err}`);
+          }));
+        }, 200)
+      })
+
+      let onTrackCount = 0
+      let onDataChannelCalled = false
+
+      pc2.addEventListener('track', t.step_func(() => {
+        onTrackCount++;
+        if (onTrackCount === 2 && onDataChannelCalled) {
+          onConnected();
+        }
+      }));
+
+      pc2.addEventListener('datachannel', t.step_func(() => {
+        onDataChannelCalled = true;
+        if (onTrackCount === 2) {
+          onConnected();
+        }
+      }));
+
+
+      exchangeIceCandidates(pc1, pc2);
+      doSignalingHandshake(pc1, pc2);
+    }))
+    .catch(t.step_func(err => {
+      assert_unreached(`test failed with error: ${err}`);
+    }));
+
+  }, `getStats() with connected peer connections having tracks and data channel should return all mandatory to implement stats`);
+
 </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats-expected.txt
deleted file mode 100644
index 14a1935..0000000
--- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL sender.getStats() should return stats report containing outbound-rtp stats pc.addTransceiver is not a function
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.https-expected.txt
new file mode 100644
index 0000000..668d1aa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.https-expected.txt
@@ -0,0 +1,5 @@
+This is a testharness.js-based test.
+FAIL sender.getStats() via addTransceiver should return stats report containing outbound-rtp stats pc.addTransceiver is not a function
+FAIL sender.getStats() via addTrack should return stats report containing outbound-rtp stats promise_test: Unhandled rejection with value: object "TypeError: sender.getStats is not a function"
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.html b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.https.html
similarity index 69%
rename from third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.html
rename to third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.https.html
index 00aa680..e5cb1eb 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCRtpSender-getStats.https.html
@@ -9,8 +9,8 @@
   'use strict';
 
   // Test is based on the following editor draft:
-  // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html
-  // https://w3c.github.io/webrtc-stats/archives/20170614/webrtc-stats.html
+  // webrtc-pc 20171130
+  // webrtc-stats 20171122
 
   // The following helper function is called from RTCStats-helper.js
   //   validateStatsReport
@@ -18,11 +18,6 @@
 
   /*
     5.2.  RTCRtpSender Interface
-      interface RTCRtpSender {
-         Promise<RTCStatsReport> getStats();
-          ...
-      };
-
       getStats
         1.  Let selector be the RTCRtpSender object on which the method was invoked.
         2.  Let p be a new promise, and run the following steps in parallel:
@@ -49,6 +44,22 @@
       validateStatsReport(statsReport);
       assert_stats_report_has_stats(statsReport, ['outbound-rtp']);
     });
-  }, 'sender.getStats() should return stats report containing outbound-rtp stats');
+  }, 'sender.getStats() via addTransceiver should return stats report containing outbound-rtp stats');
+
+  promise_test(() => {
+    const pc = new RTCPeerConnection();
+
+    return navigator.mediaDevices.getUserMedia({ audio: true })
+    .then(mediaStream => {
+      const [track] = mediaStream.getTracks();
+      const sender = pc.addTrack(track, mediaStream);
+
+      return sender.getStats()
+      .then(statsReport => {
+        validateStatsReport(statsReport);
+        assert_stats_report_has_stats(statsReport, ['outbound-rtp']);
+      });
+    })
+  }, 'sender.getStats() via addTrack should return stats report containing outbound-rtp stats');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCStats-helper.js b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCStats-helper.js
index 332ebb3f..2888246 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCStats-helper.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/RTCStats-helper.js
@@ -1,18 +1,12 @@
 'use strict';
 
 // Test is based on the following editor draft:
-// https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html
-// https://w3c.github.io/webrtc-stats/archives/20170614/webrtc-stats.html
-
+// webrtc-pc 20171130
+// webrtc-stats 20171122
 
 // This file depends on dictionary-helper.js which should
 // be loaded from the main HTML file.
 
-// To improve readability, the WebIDL definitions of the Stats
-// dictionaries are modified to annotate with required fields when
-// they are required by section 8.6 of webrtc-pc. ID fields are
-// also annotated with the stats type that they are linked to.
-
 /*
   [webrtc-stats]
   6.1.  RTCStatsType enum
@@ -82,6 +76,16 @@
   }
 }
 
+function findStatsFromReport(statsReport, predicate, message) {
+  for (const stats of statsReport.values()) {
+    if (predicate(stats)) {
+      return stats;
+    }
+  }
+
+  assert_unreached(message || 'none of stats in statsReport satisfy given condition')
+}
+
 // Get stats object of type that is expected to be
 // found in the statsReport
 function getRequiredStats(statsReport, type) {
@@ -141,35 +145,32 @@
   [webrtc-stats]
   7.1.  RTCRTPStreamStats dictionary
     dictionary RTCRTPStreamStats : RTCStats {
-      required  unsigned long      ssrc;
-      required  DOMString          mediaType;
-
-      [RTCMediaStreamTrackStats]
-      required  DOMString          trackId;
-
-      [RTCTransportStats]
-      required  DOMString          transportId;
-
-      [RTCCodecStats]
-      required  DOMString          codecId;
-
-                unsigned long      firCount;
-                unsigned long      pliCount;
-      required  unsigned long      nackCount;
-                unsigned long      sliCount;
-                unsigned long long qpSum;
+      unsigned long      ssrc;
+      DOMString          mediaType;
+      DOMString          trackId;
+      DOMString          transportId;
+      DOMString          codecId;
+      unsigned long      firCount;
+      unsigned long      pliCount;
+      unsigned long      nackCount;
+      unsigned long      sliCount;
+      unsigned long long qpSum;
     };
 
+    mediaType of type DOMString
+      Either "audio" or "video".
+
   [webrtc-pc]
   8.6.  Mandatory To Implement Stats
-    - RTCRTPStreamStats, with attributes ssrc, associateStatsId, isRemote, mediaType,
-      mediaTrackId, transportId, codecId, nackCount
+    - RTCRTPStreamStats, with attributes ssrc, mediaType, trackId,
+      transportId, codecId, nackCount
  */
 function validateRtpStreamStats(statsReport, stats) {
   validateRtcStats(statsReport, stats);
 
   assert_unsigned_int_field(stats, 'ssrc');
   assert_string_field(stats, 'mediaType');
+  assert_enum_field(stats, 'mediaType', ['audio', 'video'])
 
   validateIdField(statsReport, stats, 'trackId', 'track');
   validateIdField(statsReport, stats, 'transportId', 'transport');
@@ -186,15 +187,12 @@
   [webrtc-stats]
   7.2.  RTCCodecStats dictionary
     dictionary RTCCodecStats : RTCStats {
-      required  unsigned long payloadType;
-      required  RTCCodecType  codecType;
-
-      [RTCTransportStats]
+      unsigned long payloadType;
+      RTCCodecType  codecType;
       DOMString     transportId;
-
       DOMString     mimeType;
-      required  unsigned long clockRate;
-      required  unsigned long channels;
+      unsigned long clockRate;
+      unsigned long channels;
       DOMString     sdpFmtpLine;
       DOMString     implementation;
     };
@@ -206,7 +204,7 @@
 
   [webrtc-pc]
   8.6.  Mandatory To Implement Stats
-    - RTCCodecStats, with attributes payloadType, codec, clockRate, channels, parameters
+    - RTCCodecStats, with attributes payloadType, codec, clockRate, channels, sdpFmtpLine
  */
 
 function validateCodecStats(statsReport, stats) {
@@ -221,7 +219,7 @@
   assert_unsigned_int_field(stats, 'clockRate');
   assert_unsigned_int_field(stats, 'channels');
 
-  assert_optional_string_field(stats, 'sdpFmtpLine');
+  assert_string_field(stats, 'sdpFmtpLine');
   assert_optional_string_field(stats, 'implementation');
 }
 
@@ -229,34 +227,42 @@
   [webrtc-stats]
   7.3.  RTCReceivedRTPStreamStats dictionary
     dictionary RTCReceivedRTPStreamStats : RTCRTPStreamStats {
-      unsigned long      packetsReceived;
-      unsigned long long bytesReceived;
-      unsigned long      packetsLost;
-      double             jitter;
-      double             fractionLost;
-      unsigned long      packetsDiscarded;
-      unsigned long      packetsRepaired;
-      unsigned long      burstPacketsLost;
-      unsigned long      burstPacketsDiscarded;
-      unsigned long      burstLossCount;
-      unsigned long      burstDiscardCount;
-      double             burstLossRate;
-      double             burstDiscardRate;
-      double             gapLossRate;
-      double             gapDiscardRate;
+        unsigned long      packetsReceived;
+        unsigned long long bytesReceived;
+        long               packetsLost;
+        double             jitter;
+        double             fractionLost;
+        unsigned long      packetsDiscarded;
+        unsigned long      packetsFailedDecryption;
+        unsigned long      packetsRepaired;
+        unsigned long      burstPacketsLost;
+        unsigned long      burstPacketsDiscarded;
+        unsigned long      burstLossCount;
+        unsigned long      burstDiscardCount;
+        double             burstLossRate;
+        double             burstDiscardRate;
+        double             gapLossRate;
+        double             gapDiscardRate;
     };
+
+    [webrtc-pc]
+    8.6.  Mandatory To Implement Stats
+      - RTCReceivedRTPStreamStats, with all required attributes from its
+        inherited dictionaries, and also attributes packetsReceived,
+        bytesReceived, packetsLost, jitter, packetsDiscarded
  */
 function validateReceivedRtpStreamStats(statsReport, stats) {
   validateRtpStreamStats(statsReport, stats);
 
-  assert_optional_unsigned_int_field(stats, 'packetsReceived');
-  assert_optional_unsigned_int_field(stats, 'bytesReceived');
-  assert_optional_unsigned_int_field(stats, 'packetsLost');
+  assert_unsigned_int_field(stats, 'packetsReceived');
+  assert_unsigned_int_field(stats, 'bytesReceived');
+  assert_unsigned_int_field(stats, 'packetsLost');
 
-  assert_optional_number_field(stats, 'jitter');
+  assert_number_field(stats, 'jitter');
   assert_optional_number_field(stats, 'fractionLost');
 
-  assert_optional_unsigned_int_field(stats, 'packetsDiscarded');
+  assert_unsigned_int_field(stats, 'packetsDiscarded');
+  assert_optional_unsigned_int_field(stats, 'packetsFailedDecryption');
   assert_optional_unsigned_int_field(stats, 'packetsRepaired');
   assert_optional_unsigned_int_field(stats, 'burstPacketsLost');
   assert_optional_unsigned_int_field(stats, 'burstPacketsDiscarded');
@@ -273,37 +279,21 @@
   [webrtc-stats]
   7.4.  RTCInboundRTPStreamStats dictionary
     dictionary RTCInboundRTPStreamStats : RTCReceivedRTPStreamStats {
-      required  unsigned long      packetsReceived;
-      required  unsigned long long bytesReceived;
-      required  unsigned long      packetsLost;
-      required  double             jitter;
-      required  unsigned long      packetsDiscarded;
-
-      [RTCRemoteOutboundRTPStreamStats]
       DOMString           remoteId;
-
       unsigned long       framesDecoded;
       DOMHighResTimeStamp lastPacketReceivedTimestamp;
     };
 
   [webrtc-pc]
   8.6.  Mandatory To Implement Stats
-    - RTCInboundRTPStreamStats, with all required attributes from RTCRTPStreamStats,
-      and also attributes packetsReceived, bytesReceived, packetsLost, jitter,
-      packetsDiscarded
+    - RTCInboundRTPStreamStats, with all required attributes from its inherited
+      dictionaries, and also attributes remoteId, framesDecoded
  */
 function validateInboundRtpStreamStats(statsReport, stats) {
   validateReceivedRtpStreamStats(statsReport, stats);
 
-  assert_unsigned_int_field(stats, 'packetsReceived');
-  assert_unsigned_int_field(stats, 'bytesReceived');
-  assert_unsigned_int_field(stats, 'packetsLost');
-  assert_number_field(stats, 'jitter');
-  assert_unsigned_int_field(stats, 'packetsDiscarded');
-
-  validateOptionalIdField(statsReport, stats, 'remoteId', 'remote-outbound-rtp');
-
-  assert_optional_unsigned_int_field(stats, 'framesDecoded');
+  validateIdField(statsReport, stats, 'remoteId', 'remote-outbound-rtp');
+  assert_unsigned_int_field(stats, 'framesDecoded');
   assert_optional_number_field(stats, 'lastPacketReceivedTimeStamp');
 }
 
@@ -311,18 +301,20 @@
   [webrtc-stats]
   7.5.  RTCRemoteInboundRTPStreamStats dictionary
     dictionary RTCRemoteInboundRTPStreamStats : RTCReceivedRTPStreamStats {
-      [RTCOutboundRTPStreamStats]
-      DOMString localId;
-
-      double    roundTripTime;
+        DOMString localId;
+        double    roundTripTime;
     };
- */
 
+  [webrtc-pc]
+  8.6.  Mandatory To Implement Stats
+    - RTCRemoteInboundRTPStreamStats, with all required attributes from its
+      inherited dictionaries, and also attributes localId, roundTripTime
+ */
 function validateRemoteInboundRtpStreamStats(statsReport, stats) {
   validateReceivedRtpStreamStats(statsReport, stats);
 
-  validateOptionalIdField(statsReport, stats, 'localId', 'outbound-rtp');
-  assert_optional_number_field(stats, 'roundTripTime');
+  validateIdField(statsReport, stats, 'localId', 'outbound-rtp');
+  assert_number_field(stats, 'roundTripTime');
 }
 
 /*
@@ -334,13 +326,18 @@
       unsigned long long bytesSent;
       unsigned long long bytesDiscardedOnSend;
     };
+
+    [webrtc-pc]
+    8.6.  Mandatory To Implement Stats
+      - RTCSentRTPStreamStats, with all required attributes from its inherited
+        dictionaries, and also attributes packetsSent, bytesSent
  */
 function validateSentRtpStreamStats(statsReport, stats) {
   validateRtpStreamStats(statsReport, stats);
 
-  assert_optional_unsigned_int_field(stats, 'packetsSent');
+  assert_unsigned_int_field(stats, 'packetsSent');
   assert_optional_unsigned_int_field(stats, 'packetsDiscardedOnSend');
-  assert_optional_unsigned_int_field(stats, 'bytesSent');
+  assert_unsigned_int_field(stats, 'bytesSent');
   assert_optional_unsigned_int_field(stats, 'bytesDiscardedOnSend');
 }
 
@@ -348,12 +345,7 @@
   [webrtc-stats]
   7.7.  RTCOutboundRTPStreamStats dictionary
     dictionary RTCOutboundRTPStreamStats : RTCSentRTPStreamStats {
-      required  unsigned long      packetsSent;
-      required  unsigned long long bytesSent;
-
-      [RTCRemoteInboundRTPStreamStats]
       DOMString           remoteId;
-
       DOMHighResTimeStamp lastPacketSentTimestamp;
       double              targetBitrate;
       unsigned long       framesEncoded;
@@ -361,20 +353,19 @@
       double              averageRTCPInterval;
     };
 
-  [webrtc-pc]
-  8.6.  Mandatory To Implement Stats
-    - RTCOutboundRTPStreamStats, with all required attributes from RTCRTPStreamStats,
-      and also attributes packetsSent, bytesSent, roundTripTime
+    [webrtc-pc]
+    8.6.  Mandatory To Implement Stats
+      - RTCOutboundRTPStreamStats, with all required attributes from its
+        inherited dictionaries, and also attributes remoteId, framesEncoded
  */
 function validateOutboundRtpStreamStats(statsReport, stats) {
-  validateOptionalIdField(statsReport, stats, 'remoteId', 'remote-inbound-rtp');
+  validateSentRtpStreamStats(statsReport, stats)
 
-  assert_unsigned_int_field(stats, 'packetsSent');
-  assert_unsigned_int_field(stats, 'bytesSent');
+  validateIdField(statsReport, stats, 'remoteId', 'remote-inbound-rtp');
 
   assert_optional_number_field(stats, 'lastPacketSentTimestamp');
   assert_optional_number_field(stats, 'targetBitrate');
-  assert_optional_unsigned_int_field(stats, 'framesEncoded');
+  assert_unsigned_int_field(stats, 'framesEncoded');
   assert_optional_number_field(stats, 'totalEncodeTime');
   assert_optional_number_field(stats, 'averageRTCPInterval');
 }
@@ -383,17 +374,20 @@
   [webrtc-stats]
   7.8.  RTCRemoteOutboundRTPStreamStats dictionary
     dictionary RTCRemoteOutboundRTPStreamStats : RTCSentRTPStreamStats {
-      [RTCInboundRTPStreamStats]
       DOMString           localId;
-
       DOMHighResTimeStamp remoteTimestamp;
     };
+
+  [webrtc-pc]
+  8.6.  Mandatory To Implement Stats
+    - RTCRemoteOutboundRTPStreamStats, with all required attributes from its
+      inherited dictionaries, and also attributes localId, remoteTimestamp
  */
 function validateRemoteOutboundRtpStreamStats(statsReport, stats) {
   validateSentRtpStreamStats(statsReport, stats);
 
-  validateOptionalIdField(statsReport, stats, 'localId', 'inbound-rtp');
-  assert_optional_number_field(stats, 'remoteTimeStamp');
+  validateIdField(statsReport, stats, 'localId', 'inbound-rtp');
+  assert_number_field(stats, 'remoteTimeStamp');
 }
 
 /*
@@ -401,10 +395,7 @@
   7.9.  RTCRTPContributingSourceStats
     dictionary RTCRTPContributingSourceStats : RTCStats {
       unsigned long contributorSsrc;
-
-      [RTCInboundRTPStreamStats]
       DOMString     inboundRtpStreamId;
-
       unsigned long packetsContributedTo;
       double        audioLevel;
     };
@@ -423,10 +414,10 @@
   [webrtc-stats]
   7.10. RTCPeerConnectionStats dictionary
     dictionary RTCPeerConnectionStats : RTCStats {
-      required  unsigned long dataChannelsOpened;
-      required  unsigned long dataChannelsClosed;
-                unsigned long dataChannelsRequested;
-                unsigned long dataChannelsAccepted;
+      unsigned long dataChannelsOpened;
+      unsigned long dataChannelsClosed;
+      unsigned long dataChannelsRequested;
+      unsigned long dataChannelsAccepted;
     };
 
   [webrtc-pc]
@@ -446,10 +437,8 @@
   [webrtc-stats]
   7.11. RTCMediaStreamStats dictionary
     dictionary RTCMediaStreamStats : RTCStats {
-      required  DOMString           streamIdentifier;
-
-      [RTCMediaStreamTrackStats]
-      required  sequence<DOMString> trackIds;
+      DOMString           streamIdentifier;
+      sequence<DOMString> trackIds;
     };
 
   [webrtc-pc]
@@ -479,35 +468,37 @@
   [webrtc-stats]
   7.12. RTCMediaStreamTrackStats dictionary
     dictionary RTCMediaStreamTrackStats : RTCStats {
-      required  DOMString           trackIdentifier;
-      required  boolean             remoteSource;
-      required  boolean             ended;
-      required  boolean             detached;
-                DOMString           kind;
-                DOMHighResTimeStamp estimatedPlayoutTimestamp;
-      required  unsigned long       frameWidth;
-      required  unsigned long       frameHeight;
-      required  double              framesPerSecond;
-                unsigned long       framesCaptured;
-      required  unsigned long       framesSent;
-      required  unsigned long       framesReceived;
-      required  unsigned long       framesDecoded;
-      required  unsigned long       framesDropped;
-      required  unsigned long       framesCorrupted;
-                unsigned long       partialFramesLost;
-                unsigned long       fullFramesLost;
-      required  double              audioLevel;
-                double              totalAudioEnergy;
-                boolean             voiceActivityFlag;
-                double              echoReturnLoss;
-                double              echoReturnLossEnhancement;
-                unsigned long long  totalSamplesSent;
-                unsigned long long  totalSamplesReceived;
-                double              totalSamplesDuration;
-                unsigned long long  concealedSamples;
-                unsigned long long  concealmentEvents;
-                double              jitterBufferDelay;
-                RTCPriorityType     priority;
+      DOMString           trackIdentifier;
+      boolean             remoteSource;
+      boolean             ended;
+      boolean             detached;
+      DOMString           kind;
+      DOMHighResTimeStamp estimatedPlayoutTimestamp;
+      unsigned long       frameWidth;
+      unsigned long       frameHeight;
+      double              framesPerSecond;
+      unsigned long       framesCaptured;
+      unsigned long       framesSent;
+      unsigned long       keyFramesSent;
+      unsigned long       framesReceived;
+      unsigned long       keyFramesReceived;
+      unsigned long       framesDecoded;
+      unsigned long       framesDropped;
+      unsigned long       framesCorrupted;
+      unsigned long       partialFramesLost;
+      unsigned long       fullFramesLost;
+      double              audioLevel;
+      double              totalAudioEnergy;
+      boolean             voiceActivityFlag;
+      double              echoReturnLoss;
+      double              echoReturnLossEnhancement;
+      unsigned long long  totalSamplesSent;
+      unsigned long long  totalSamplesReceived;
+      double              totalSamplesDuration;
+      unsigned long long  concealedSamples;
+      unsigned long long  concealmentEvents;
+      double              jitterBufferDelay;
+      RTCPriorityType     priority;
     };
 
   [webrtc-pc]
@@ -520,8 +511,8 @@
     };
 
   8.6.  Mandatory To Implement Stats
-    - RTCMediaStreamTrackStats, with attributes trackIdentifier, remoteSource, ended,
-      detached, ssrcIds, frameWidth, frameHeight, framesPerSecond, framesSent,
+    - RTCMediaStreamTrackStats, with attributes trackIdentifier, remoteSource,
+      ended, detached, frameWidth, frameHeight, framesPerSecond, framesSent,
       framesReceived, framesDecoded, framesDropped, framesCorrupted, audioLevel
  */
 
@@ -533,7 +524,7 @@
   assert_boolean_field(stats, 'ended');
   assert_boolean_field(stats, 'detached');
 
-  assert_optional_string_field(stats, 'kind');
+  assert_optional_enum_field(stats, 'kind', ['audio', 'video']);
   assert_optional_number_field(stats, 'estimatedPlayoutTimestamp');
 
   assert_unsigned_int_field(stats, 'frameWidth');
@@ -541,11 +532,13 @@
   assert_number_field(stats, 'framesPerSecond');
 
   assert_optional_unsigned_int_field(stats, 'framesCaptured');
-  assert_unsigned_int_field(stats, 'frameSent');
-  assert_unsigned_int_field(stats, 'frameReceived');
-  assert_unsigned_int_field(stats, 'frameDecoded');
-  assert_unsigned_int_field(stats, 'frameDropped');
-  assert_unsigned_int_field(stats, 'frameCorrupted');
+  assert_unsigned_int_field(stats, 'framesSent');
+  assert_optional_unsigned_int_field(stats, 'keyFramesSent');
+  assert_unsigned_int_field(stats, 'framesReceived');
+  assert_optional_unsigned_int_field(stats, 'keyFramesReceived');
+  assert_unsigned_int_field(stats, 'framesDecoded');
+  assert_unsigned_int_field(stats, 'framesDropped');
+  assert_unsigned_int_field(stats, 'framesCorrupted');
 
   assert_optional_unsigned_int_field(stats, 'partialFramesLost');
   assert_optional_unsigned_int_field(stats, 'fullFramesLost');
@@ -571,18 +564,15 @@
   [webrtc-stats]
   7.13. RTCDataChannelStats dictionary
     dictionary RTCDataChannelStats : RTCStats {
-      required  DOMString           label;
-      required  DOMString           protocol;
-      required  long                datachannelid;
-
-      [RTCTransportStats]
-                DOMString           transportId;
-
-      required  RTCDataChannelState state;
-      required  unsigned long       messagesSent;
-      required  unsigned long long  bytesSent;
-      required  unsigned long       messagesReceived;
-      required  unsigned long long  bytesReceived;
+      DOMString           label;
+      DOMString           protocol;
+      long                dataChannelIdentifier;
+      DOMString           transportId;
+      RTCDataChannelState state;
+      unsigned long       messagesSent;
+      unsigned long long  bytesSent;
+      unsigned long       messagesReceived;
+      unsigned long long  bytesReceived;
     };
 
   [webrtc-pc]
@@ -598,22 +588,19 @@
     - RTCDataChannelStats, with attributes label, protocol, datachannelId, state,
       messagesSent, bytesSent, messagesReceived, bytesReceived
  */
-
 function validateDataChannelStats(statsReport, stats) {
   validateRtcStats(statsReport, stats);
 
   assert_string_field(stats, 'label');
   assert_string_field(stats, 'protocol');
-  assert_int_field(stats, 'datachannelid');
+  assert_int_field(stats, 'dataChannelIdentifier');
 
   validateOptionalIdField(statsReport, stats, 'transportId', 'transport');
 
   assert_enum_field(stats, 'state',
     ['connecting', 'open', 'closing', 'closed']);
 
-  assert_unsigned_int_field(stats, 'messageSent');
-
-  assert_unsigned_int_field(stats, 'messageSent');
+  assert_unsigned_int_field(stats, 'messagesSent');
   assert_unsigned_int_field(stats, 'bytesSent');
   assert_unsigned_int_field(stats, 'messagesReceived');
   assert_unsigned_int_field(stats, 'bytesReceived');
@@ -623,25 +610,16 @@
   [webrtc-stats]
   7.14. RTCTransportStats dictionary
     dictionary RTCTransportStats : RTCStats {
-                unsigned long         packetsSent;
-                unsigned long         packetsReceived;
-      required  unsigned long long    bytesSent;
-      required  unsigned long long    bytesReceived;
-
-      [RTCTransportStats]
-      required  DOMString             rtcpTransportStatsId;
-
-                RTCIceRole            iceRole;
-                RTCDtlsTransportState dtlsState;
-
-      [RTCIceCandidatePairStats]
-      required  DOMString             selectedCandidatePairId;
-
-      [RTCCertificateStats]
-      required  DOMString             localCertificateId;
-
-      [RTCCertificateStats]
-      required  DOMString             remoteCertificateId;
+      unsigned long         packetsSent;
+      unsigned long         packetsReceived;
+      unsigned long long    bytesSent;
+      unsigned long long    bytesReceived;
+      DOMString             rtcpTransportStatsId;
+      RTCIceRole            iceRole;
+      RTCDtlsTransportState dtlsState;
+      DOMString             selectedCandidatePairId;
+      DOMString             localCertificateId;
+      DOMString             remoteCertificateId;
     };
 
   [webrtc-pc]
@@ -661,10 +639,10 @@
     };
 
   8.6.  Mandatory To Implement Stats
-    - RTCTransportStats, with attributes bytesSent, bytesReceived, rtcpTransportStatsId,
-      activeConnection, selectedCandidatePairId, localCertificateId, remoteCertificateId
+    - RTCTransportStats, with attributes bytesSent, bytesReceived,
+      rtcpTransportStatsId, selectedCandidatePairId, localCertificateId,
+      remoteCertificateId
  */
-
 function validateTransportStats(statsReport, stats) {
   validateRtcStats(statsReport, stats);
 
@@ -690,18 +668,27 @@
   [webrtc-stats]
   7.15. RTCIceCandidateStats dictionary
     dictionary RTCIceCandidateStats : RTCStats {
-      [RTCTransportStats]
-                DOMString           transportId;
+      DOMString           transportId;
+      boolean             isRemote;
+      RTCNetworkType      networkType;
+      DOMString           ip;
+      long                port;
+      DOMString           protocol;
+      RTCIceCandidateType candidateType;
+      long                priority;
+      DOMString           url;
+      DOMString           relayProtocol;
+      boolean             deleted = false;
+    };
 
-                boolean             isRemote;
-      required  DOMString           ip;
-      required  long                port;
-      required  DOMString           protocol;
-      required  RTCIceCandidateType candidateType;
-      required  long                priority;
-      required  DOMString           url;
-                DOMString           relayProtocol;
-                boolean             deleted = false;
+    enum RTCNetworkType {
+      "bluetooth",
+      "cellular",
+      "ethernet",
+      "wifi",
+      "wimax",
+      "vpn",
+      "unknown"
     };
 
   [webrtc-pc]
@@ -714,16 +701,18 @@
     };
 
   8.6.  Mandatory To Implement Stats
-    - RTCIceCandidateStats, with attributes ip, port, protocol, candidateType, priority,
-      url
+    - RTCIceCandidateStats, with attributes ip, port, protocol, candidateType,
+      priority, url
  */
-
 function validateIceCandidateStats(statsReport, stats) {
   validateRtcStats(statsReport, stats);
 
   validateOptionalIdField(statsReport, stats, 'transportId', 'transport');
   assert_optional_boolean_field(stats, 'isRemote');
 
+  assert_optional_enum_field(stats, 'networkType',
+    ['bluetooth', 'cellular', 'ethernet', 'wifi', 'wimax', 'vpn', 'unknown'])
+
   assert_string_field(stats, 'ip');
   assert_int_field(stats, 'port');
   assert_string_field(stats, 'protocol');
@@ -741,40 +730,34 @@
   [webrtc-stats]
   7.16. RTCIceCandidatePairStats dictionary
     dictionary RTCIceCandidatePairStats : RTCStats {
-      [RTCTransportStats]
-      required  DOMString                     transportId;
-
-      [RTCIceCandidateStats]
-      required  DOMString                     localCandidateId;
-
-      [RTCIceCandidateStats]
-      required  DOMString                     remoteCandidateId;
-
-      required  RTCStatsIceCandidatePairState state;
-      required  unsigned long long            priority;
-      required  boolean                       nominated;
-                unsigned long                 packetsSent;
-                unsigned long                 packetsReceived;
-      required  unsigned long long            bytesSent;
-      required  unsigned long long            bytesReceived;
-                DOMHighResTimeStamp           lastPacketSentTimestamp;
-                DOMHighResTimeStamp           lastPacketReceivedTimestamp;
-                DOMHighResTimeStamp           firstRequestTimestamp;
-                DOMHighResTimeStamp           lastRequestTimestamp;
-                DOMHighResTimeStamp           lastResponseTimestamp;
-      required  double                        totalRoundTripTime;
-      required  double                        currentRoundTripTime;
-                double                        availableOutgoingBitrate;
-                double                        availableIncomingBitrate;
-                unsigned long                 circuitBreakerTriggerCount;
-                unsigned long long            requestsReceived;
-                unsigned long long            requestsSent;
-                unsigned long long            responsesReceived;
-                unsigned long long            responsesSent;
-                unsigned long long            retransmissionsReceived;
-                unsigned long long            retransmissionsSent;
-                unsigned long long            consentRequestsSent;
-                DOMHighResTimeStamp           consentExpiredTimestamp;
+      DOMString                     transportId;
+      DOMString                     localCandidateId;
+      DOMString                     remoteCandidateId;
+      RTCStatsIceCandidatePairState state;
+      unsigned long long            priority;
+      boolean                       nominated;
+      unsigned long                 packetsSent;
+      unsigned long                 packetsReceived;
+      unsigned long long            bytesSent;
+      unsigned long long            bytesReceived;
+      DOMHighResTimeStamp           lastPacketSentTimestamp;
+      DOMHighResTimeStamp           lastPacketReceivedTimestamp;
+      DOMHighResTimeStamp           firstRequestTimestamp;
+      DOMHighResTimeStamp           lastRequestTimestamp;
+      DOMHighResTimeStamp           lastResponseTimestamp;
+      double                        totalRoundTripTime;
+      double                        currentRoundTripTime;
+      double                        availableOutgoingBitrate;
+      double                        availableIncomingBitrate;
+      unsigned long                 circuitBreakerTriggerCount;
+      unsigned long long            requestsReceived;
+      unsigned long long            requestsSent;
+      unsigned long long            responsesReceived;
+      unsigned long long            responsesSent;
+      unsigned long long            retransmissionsReceived;
+      unsigned long long            retransmissionsSent;
+      unsigned long long            consentRequestsSent;
+      DOMHighResTimeStamp           consentExpiredTimestamp;
     };
 
     enum RTCStatsIceCandidatePairState {
@@ -788,8 +771,7 @@
   [webrtc-pc]
   8.6.  Mandatory To Implement Stats
     - RTCIceCandidatePairStats, with attributes transportId, localCandidateId,
-      remoteCandidateId, state, priority, nominated, writable, readable, bytesSent,
-      bytesReceived, totalRtt, currentRtt
+      remoteCandidateId, state, priority, nominated, bytesSent, bytesReceived, totalRoundTripTime, currentRoundTripTime
  */
 function validateIceCandidatePairStats(statsReport, stats) {
   validateRtcStats(statsReport, stats);
@@ -835,10 +817,10 @@
   [webrtc-stats]
   7.17. RTCCertificateStats dictionary
     dictionary RTCCertificateStats : RTCStats {
-      required  DOMString fingerprint;
-      required  DOMString fingerprintAlgorithm;
-      required  DOMString base64Certificate;
-      required  DOMString issuerCertificateId;
+      DOMString fingerprint;
+      DOMString fingerprintAlgorithm;
+      DOMString base64Certificate;
+      DOMString issuerCertificateId;
     };
 
   [webrtc-pc]
@@ -846,7 +828,6 @@
     - RTCCertificateStats, with attributes fingerprint, fingerprintAlgorithm,
       base64Certificate, issuerCertificateId
  */
-
 function validateCertificateStats(statsReport, stats) {
   validateRtcStats(statsReport, stats);
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js b/third_party/WebKit/LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js
index 400f065..f0244a2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js
+++ b/third_party/WebKit/LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js
@@ -17,9 +17,9 @@
     try {
       assert_true('NotificationEvent' in self);
 
-      assert_throws(null, () => new NotificationEvent('NotificationEvent'));
-      assert_throws(null, () => new NotificationEvent('NotificationEvent', {}));
-      assert_throws(null, () => new NotificationEvent('NotificationEvent', { notification: null }));
+      assert_throws(new TypeError(), () => new NotificationEvent('NotificationEvent'));
+      assert_throws(new TypeError(), () => new NotificationEvent('NotificationEvent', {}));
+      assert_throws(new TypeError(), () => new NotificationEvent('NotificationEvent', { notification: null }));
 
       const event = new NotificationEvent('NotificationEvent', { notification });