OLD | NEW |
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 "content/browser/service_worker/service_worker_process_manager.h" | 6 #include "content/browser/service_worker/service_worker_process_manager.h" |
7 #include "content/public/test/test_browser_thread_bundle.h" | 7 #include "content/public/test/test_browser_thread_bundle.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class ServiceWorkerProcessManagerTest : public testing::Test { | 14 class ServiceWorkerProcessManagerTest : public testing::Test { |
15 public: | 15 public: |
16 ServiceWorkerProcessManagerTest() {} | 16 ServiceWorkerProcessManagerTest() {} |
17 | 17 |
18 virtual void SetUp() OVERRIDE { | 18 virtual void SetUp() override { |
19 process_manager_.reset(new ServiceWorkerProcessManager(NULL)); | 19 process_manager_.reset(new ServiceWorkerProcessManager(NULL)); |
20 pattern_ = GURL("http://www.example.com/"); | 20 pattern_ = GURL("http://www.example.com/"); |
21 } | 21 } |
22 | 22 |
23 virtual void TearDown() OVERRIDE { | 23 virtual void TearDown() override { |
24 process_manager_.reset(); | 24 process_manager_.reset(); |
25 } | 25 } |
26 | 26 |
27 protected: | 27 protected: |
28 scoped_ptr<ServiceWorkerProcessManager> process_manager_; | 28 scoped_ptr<ServiceWorkerProcessManager> process_manager_; |
29 GURL pattern_; | 29 GURL pattern_; |
30 | 30 |
31 private: | 31 private: |
32 content::TestBrowserThreadBundle thread_bundle_; | 32 content::TestBrowserThreadBundle thread_bundle_; |
33 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProcessManagerTest); | 33 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProcessManagerTest); |
(...skipping 13 matching lines...) Expand all Loading... |
47 testing::ElementsAre(2, 1, 3)); | 47 testing::ElementsAre(2, 1, 3)); |
48 | 48 |
49 process_manager_->RemoveProcessReferenceFromPattern(pattern_, 1); | 49 process_manager_->RemoveProcessReferenceFromPattern(pattern_, 1); |
50 process_manager_->RemoveProcessReferenceFromPattern(pattern_, 1); | 50 process_manager_->RemoveProcessReferenceFromPattern(pattern_, 1); |
51 // Scores for each process: 2 : 3, 3 : 1, process 1 is removed. | 51 // Scores for each process: 2 : 3, 3 : 1, process 1 is removed. |
52 EXPECT_THAT(process_manager_->SortProcessesForPattern(pattern_), | 52 EXPECT_THAT(process_manager_->SortProcessesForPattern(pattern_), |
53 testing::ElementsAre(2, 3)); | 53 testing::ElementsAre(2, 3)); |
54 } | 54 } |
55 | 55 |
56 } // namespace content | 56 } // namespace content |
OLD | NEW |