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

Side by Side Diff: chrome/browser/budget_service/budget_manager_browsertest.cc

Issue 2452833004: Fix flaky SW registration in PushMessaging/BudgetManager browser tests (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/push_messaging/push_messaging_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_helpers.h" 5 #include "base/bind_helpers.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/budget_service/budget_manager.h" 9 #include "chrome/browser/budget_service/budget_manager.h"
10 #include "chrome/browser/budget_service/budget_manager_factory.h" 10 #include "chrome/browser/budget_service/budget_manager_factory.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 // Consume should succeed because there is an existing reservation. 112 // Consume should succeed because there is an existing reservation.
113 ConsumeReservation(); 113 ConsumeReservation();
114 ASSERT_TRUE(success()); 114 ASSERT_TRUE(success());
115 115
116 // Second consume should fail because the reservation is consumed. 116 // Second consume should fail because the reservation is consumed.
117 ConsumeReservation(); 117 ConsumeReservation();
118 ASSERT_FALSE(success()); 118 ASSERT_FALSE(success());
119 } 119 }
120 120
121 // Flaky on ChromeOS and Linux. See http://crbug.com/657202. 121 IN_PROC_BROWSER_TEST_F(BudgetManagerBrowserTest, BudgetInWorker) {
122 #if defined(OS_CHROMEOS) || defined(OS_LINUX)
123 #define MAYBE_BudgetInWorker DISABLED_BudgetInWorker
124 #else
125 #define MAYBE_BudgetInWorker BudgetInWorker
126 #endif
127 IN_PROC_BROWSER_TEST_F(BudgetManagerBrowserTest, MAYBE_BudgetInWorker) {
128 std::string script_result; 122 std::string script_result;
129 123
130 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result)); 124 ASSERT_TRUE(RunScript("registerServiceWorker()", &script_result));
131 ASSERT_EQ("ok - service worker registered", script_result); 125 ASSERT_EQ("ok - service worker registered", script_result);
132 126
133 LoadTestPage(); // Reload to become controlled. 127 LoadTestPage(); // Reload to become controlled.
134 128
135 ASSERT_TRUE(RunScript("isControlled()", &script_result)); 129 ASSERT_TRUE(RunScript("isControlled()", &script_result));
136 ASSERT_EQ("true - is controlled", script_result); 130 ASSERT_EQ("true - is controlled", script_result);
137 131
(...skipping 23 matching lines...) Expand all
161 155
162 ConsumeReservation(); 156 ConsumeReservation();
163 ASSERT_TRUE(success()); 157 ASSERT_TRUE(success());
164 158
165 // One more consume should fail, because all reservations are consumed. 159 // One more consume should fail, because all reservations are consumed.
166 ConsumeReservation(); 160 ConsumeReservation();
167 ASSERT_FALSE(success()); 161 ASSERT_FALSE(success());
168 } 162 }
169 163
170 } // namespace 164 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/push_messaging/push_messaging_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698