Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 1342733002: ServiceWorker: log when the script's loaded separately from thread start (chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 console_listener.WaitForConsoleMessages(1); 818 console_listener.WaitForConsoleMessages(1);
819 ASSERT_NE(base::string16::npos, 819 ASSERT_NE(base::string16::npos,
820 console_listener.messages()[0].find(expected)); 820 console_listener.messages()[0].find(expected));
821 version_->embedded_worker()->RemoveListener(&console_listener); 821 version_->embedded_worker()->RemoveListener(&console_listener);
822 } 822 }
823 823
824 class WaitForLoaded : public EmbeddedWorkerInstance::Listener { 824 class WaitForLoaded : public EmbeddedWorkerInstance::Listener {
825 public: 825 public:
826 WaitForLoaded(const base::Closure& quit) : quit_(quit) {} 826 WaitForLoaded(const base::Closure& quit) : quit_(quit) {}
827 827
828 void OnScriptLoaded() override { 828 void OnThreadStarted() override {
829 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, quit_); 829 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, quit_);
830 } 830 }
831 bool OnMessageReceived(const IPC::Message& message) override { return false; } 831 bool OnMessageReceived(const IPC::Message& message) override { return false; }
832 832
833 private: 833 private:
834 base::Closure quit_; 834 base::Closure quit_;
835 }; 835 };
836 836
837 // This test has started flaking somewhat consistently on Win, Mac and Linux. 837 // This test has started flaking somewhat consistently on Win, Mac and Linux.
838 // Disabling for now, see http://crbug.com/496065. 838 // Disabling for now, see http://crbug.com/496065.
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 ASSERT_EQ(SERVICE_WORKER_OK, status); 1279 ASSERT_EQ(SERVICE_WORKER_OK, status);
1280 // Stop the worker. 1280 // Stop the worker.
1281 StopWorker(SERVICE_WORKER_OK); 1281 StopWorker(SERVICE_WORKER_OK);
1282 // Restart the worker. 1282 // Restart the worker.
1283 StartWorker(SERVICE_WORKER_OK); 1283 StartWorker(SERVICE_WORKER_OK);
1284 // Stop the worker. 1284 // Stop the worker.
1285 StopWorker(SERVICE_WORKER_OK); 1285 StopWorker(SERVICE_WORKER_OK);
1286 } 1286 }
1287 1287
1288 } // namespace content 1288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698