summaryrefslogtreecommitdiff
path: root/chromium/content/browser/service_worker
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-08 13:07:32 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-08 13:40:10 +0000
commit818d9aed569afd192f6d4f6d9b28b72912df8b93 (patch)
treefa30cbdffa3e8fdc09dbbe37ffc0a721b40fced1 /chromium/content/browser/service_worker
parent66a2147d838e293f4a5db7711c8eba4e6faaaf0f (diff)
downloadqtwebengine-chromium-818d9aed569afd192f6d4f6d9b28b72912df8b93.tar.gz
BASELINE: Update Chromium to 65.0.3325.151
Change-Id: I3c71dd500483eb29491ac3eee4123714dda52da9 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/content/browser/service_worker')
-rw-r--r--chromium/content/browser/service_worker/service_worker_browsertest.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/chromium/content/browser/service_worker/service_worker_browsertest.cc b/chromium/content/browser/service_worker/service_worker_browsertest.cc
index 5ac5504ff07..76cdd7e5081 100644
--- a/chromium/content/browser/service_worker/service_worker_browsertest.cc
+++ b/chromium/content/browser/service_worker/service_worker_browsertest.cc
@@ -16,6 +16,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
+#include "base/metrics/statistics_recorder.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string16.h"
@@ -969,6 +970,38 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, StartAndStop) {
stop_run_loop.Run();
}
+IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest,
+ DropCountsOnBlinkUseCounter) {
+ StartServerAndNavigateToSetup();
+ RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread,
+ base::Unretained(this),
+ "/service_worker/worker.js"));
+ // Start a worker.
+ ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED;
+ base::RunLoop start_run_loop;
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::BindOnce(&self::StartOnIOThread, base::Unretained(this),
+ start_run_loop.QuitClosure(), &status));
+ start_run_loop.Run();
+ ASSERT_EQ(SERVICE_WORKER_OK, status);
+
+ // Expect no PageVisits count.
+ EXPECT_EQ(nullptr, base::StatisticsRecorder::FindHistogram(
+ "Blink.UseCounter.Features"));
+
+ // Stop the worker.
+ base::RunLoop stop_run_loop;
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::BindOnce(&self::StopOnIOThread, base::Unretained(this),
+ stop_run_loop.QuitClosure()));
+ stop_run_loop.Run();
+ // Expect no PageVisits count.
+ EXPECT_EQ(nullptr, base::StatisticsRecorder::FindHistogram(
+ "Blink.UseCounter.Features"));
+}
+
IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, StartNotFound) {
StartServerAndNavigateToSetup();
RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread,