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

Side by Side Diff: content/browser/service_worker/service_worker_handle_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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "content/browser/service_worker/embedded_worker_registry.h" 7 #include "content/browser/service_worker/embedded_worker_registry.h"
8 #include "content/browser/service_worker/embedded_worker_test_helper.h" 8 #include "content/browser/service_worker/embedded_worker_test_helper.h"
9 #include "content/browser/service_worker/service_worker_context_core.h" 9 #include "content/browser/service_worker/service_worker_context_core.h"
10 #include "content/browser/service_worker/service_worker_handle.h" 10 #include "content/browser/service_worker/service_worker_handle.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 version_ = NULL; 64 version_ = NULL;
65 helper_.reset(); 65 helper_.reset();
66 } 66 }
67 67
68 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } 68 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); }
69 69
70 TestBrowserThreadBundle browser_thread_bundle_; 70 TestBrowserThreadBundle browser_thread_bundle_;
71 scoped_ptr<EmbeddedWorkerTestHelper> helper_; 71 scoped_ptr<EmbeddedWorkerTestHelper> helper_;
72 scoped_refptr<ServiceWorkerRegistration> registration_; 72 scoped_refptr<ServiceWorkerRegistration> registration_;
73 scoped_refptr<ServiceWorkerVersion> version_; 73 scoped_refptr<ServiceWorkerVersion> version_;
74
75 private:
74 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandleTest); 76 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandleTest);
75 }; 77 };
76 78
77 TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) { 79 TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) {
78 scoped_ptr<ServiceWorkerHandle> handle = 80 scoped_ptr<ServiceWorkerHandle> handle =
79 ServiceWorkerHandle::Create(helper_->context()->AsWeakPtr(), 81 ServiceWorkerHandle::Create(helper_->context()->AsWeakPtr(),
80 helper_.get(), 82 helper_.get(),
81 1 /* thread_id */, 83 1 /* thread_id */,
82 version_); 84 version_);
83 85
(...skipping 24 matching lines...) Expand all
108 // 3. SendMessageToWorker (to send InstallEvent), and 110 // 3. SendMessageToWorker (to send InstallEvent), and
109 EXPECT_EQ(EmbeddedWorkerContextMsg_MessageToWorker::ID, 111 EXPECT_EQ(EmbeddedWorkerContextMsg_MessageToWorker::ID,
110 ipc_sink()->GetMessageAt(2)->type()); 112 ipc_sink()->GetMessageAt(2)->type());
111 // 4. StateChanged (state == Installed). 113 // 4. StateChanged (state == Installed).
112 VerifyStateChangedMessage(handle->handle_id(), 114 VerifyStateChangedMessage(handle->handle_id(),
113 blink::WebServiceWorkerStateInstalled, 115 blink::WebServiceWorkerStateInstalled,
114 ipc_sink()->GetMessageAt(3)); 116 ipc_sink()->GetMessageAt(3));
115 } 117 }
116 118
117 } // namespace content 119 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698