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

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

Issue 397933003: Service Workers: Clean up cpplint.py warnings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/browser/browser_thread_impl.h" 8 #include "content/browser/browser_thread_impl.h"
9 #include "content/browser/service_worker/embedded_worker_registry.h" 9 #include "content/browser/service_worker/embedded_worker_registry.h"
10 #include "content/browser/service_worker/embedded_worker_test_helper.h" 10 #include "content/browser/service_worker/embedded_worker_test_helper.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 ASSERT_FALSE(called); 389 ASSERT_FALSE(called);
390 base::RunLoop().RunUntilIdle(); 390 base::RunLoop().RunUntilIdle();
391 ASSERT_TRUE(called); 391 ASSERT_TRUE(called);
392 392
393 ASSERT_EQ(new_registration, old_registration); 393 ASSERT_EQ(new_registration, old_registration);
394 } 394 }
395 395
396 class FailToStartWorkerTestHelper : public EmbeddedWorkerTestHelper { 396 class FailToStartWorkerTestHelper : public EmbeddedWorkerTestHelper {
397 public: 397 public:
398 FailToStartWorkerTestHelper(int mock_render_process_id) 398 explicit FailToStartWorkerTestHelper(int mock_render_process_id)
399 : EmbeddedWorkerTestHelper(mock_render_process_id) {} 399 : EmbeddedWorkerTestHelper(mock_render_process_id) {}
400 400
401 virtual void OnStartWorker(int embedded_worker_id, 401 virtual void OnStartWorker(int embedded_worker_id,
402 int64 service_worker_version_id, 402 int64 service_worker_version_id,
403 const GURL& scope, 403 const GURL& scope,
404 const GURL& script_url) OVERRIDE { 404 const GURL& script_url) OVERRIDE {
405 // Simulate failure by sending worker stopped instead of started. 405 // Simulate failure by sending worker stopped instead of started.
406 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); 406 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id);
407 registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id); 407 registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id);
408 } 408 }
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 809
810 registration->active_version()->RemoveControllee(host.get()); 810 registration->active_version()->RemoveControllee(host.get());
811 base::RunLoop().RunUntilIdle(); 811 base::RunLoop().RunUntilIdle();
812 812
813 // The version should be stopped since there is no controllee. 813 // The version should be stopped since there is no controllee.
814 EXPECT_EQ(ServiceWorkerVersion::STOPPED, version->running_status()); 814 EXPECT_EQ(ServiceWorkerVersion::STOPPED, version->running_status());
815 EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version->status()); 815 EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version->status());
816 } 816 }
817 817
818 } // namespace content 818 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698