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

Side by Side Diff: chrome/test/data/extensions/api_test/declarative_content/persistence/background.js

Issue 1247743004: Revert of Remove race in DeclarativeContentApiTest.RulesPersistence test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 var hostPrefix = chrome.extension.inIncognitoContext ? 'test_split' : 5 var hostPrefix = chrome.extension.inIncognitoContext ? 'test_split' :
6 'test_normal'; 6 'test_normal';
7 7
8 var rule = { 8 var rule = {
9 conditions: [ 9 conditions: [
10 new chrome.declarativeContent.PageStateMatcher({ 10 new chrome.declarativeContent.PageStateMatcher({
(...skipping 18 matching lines...) Expand all
29 // chrome.storage.local, but the onInstalled event only gets sent for the 29 // chrome.storage.local, but the onInstalled event only gets sent for the
30 // non-incognito side of the extension in split incognito mode. 30 // non-incognito side of the extension in split incognito mode.
31 var key = chrome.extension.inIncognitoContext ? "split" : "normal"; 31 var key = chrome.extension.inIncognitoContext ? "split" : "normal";
32 chrome.storage.local.get(key, function(items) { 32 chrome.storage.local.get(key, function(items) {
33 if (!(key in items)) { 33 if (!(key in items)) {
34 chrome.declarativeContent.onPageChanged.addRules([rule], function() { 34 chrome.declarativeContent.onPageChanged.addRules([rule], function() {
35 items[key] = "added"; 35 items[key] = "added";
36 chrome.storage.local.set(items, sendMessage.bind(null, "ready")); 36 chrome.storage.local.set(items, sendMessage.bind(null, "ready"));
37 }); 37 });
38 } else { 38 } else {
39 sendMessage("second run ready"); 39 sendMessage(sendMessage("second run ready"));
40 } 40 }
41 }); 41 });
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698