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

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

Issue 238043002: Teach EmbeddedWorkerInstance to create a process when it needs one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle 2 places where context_ could be NULL. Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/service_worker/service_worker_storage.h" 5 #include "content/browser/service_worker/service_worker_storage.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 } // namespace 66 } // namespace
67 67
68 class ServiceWorkerStorageTest : public testing::Test { 68 class ServiceWorkerStorageTest : public testing::Test {
69 public: 69 public:
70 ServiceWorkerStorageTest() 70 ServiceWorkerStorageTest()
71 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) { 71 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) {
72 } 72 }
73 73
74 virtual void SetUp() OVERRIDE { 74 virtual void SetUp() OVERRIDE {
75 context_.reset(new ServiceWorkerContextCore(base::FilePath(), NULL, NULL)); 75 context_.reset(new ServiceWorkerContextCore(
76 base::FilePath(),
77 NULL,
78 NULL,
79 scoped_ptr<ServiceWorkerProcessManager>()));
76 context_ptr_ = context_->AsWeakPtr(); 80 context_ptr_ = context_->AsWeakPtr();
77 storage()->simulated_lazy_initted_ = true; 81 storage()->simulated_lazy_initted_ = true;
78 } 82 }
79 83
80 virtual void TearDown() OVERRIDE { 84 virtual void TearDown() OVERRIDE {
81 context_.reset(); 85 context_.reset();
82 } 86 }
83 87
84 ServiceWorkerStorage* storage() { return context_->storage(); } 88 ServiceWorkerStorage* storage() { return context_->storage(); }
85 89
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 426
423 storage()->GetAllRegistrations( 427 storage()->GetAllRegistrations(
424 MakeGetAllCallback(&was_called, &all_registrations)); 428 MakeGetAllCallback(&was_called, &all_registrations));
425 base::RunLoop().RunUntilIdle(); 429 base::RunLoop().RunUntilIdle();
426 ASSERT_TRUE(was_called); 430 ASSERT_TRUE(was_called);
427 EXPECT_TRUE(all_registrations.empty()); 431 EXPECT_TRUE(all_registrations.empty());
428 was_called = false; 432 was_called = false;
429 } 433 }
430 434
431 } // namespace content 435 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698