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

Side by Side Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_ registry.h" 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_ registry.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 public: 67 public:
68 WebRequestRulesRegistryTest() 68 WebRequestRulesRegistryTest()
69 : message_loop(MessageLoop::TYPE_IO), 69 : message_loop(MessageLoop::TYPE_IO),
70 ui(content::BrowserThread::UI, &message_loop), 70 ui(content::BrowserThread::UI, &message_loop),
71 io(content::BrowserThread::IO, &message_loop) {} 71 io(content::BrowserThread::IO, &message_loop) {}
72 72
73 virtual ~WebRequestRulesRegistryTest() {} 73 virtual ~WebRequestRulesRegistryTest() {}
74 74
75 virtual void TearDown() OVERRIDE { 75 virtual void TearDown() OVERRIDE {
76 // Make sure that deletion traits of all registries are executed. 76 // Make sure that deletion traits of all registries are executed.
77 message_loop.RunAllPending(); 77 message_loop.RunUntilIdle();
78 } 78 }
79 79
80 // Returns a rule that roughly matches http://*.example.com and 80 // Returns a rule that roughly matches http://*.example.com and
81 // https://www.example.com and cancels it 81 // https://www.example.com and cancels it
82 linked_ptr<RulesRegistry::Rule> CreateRule1() { 82 linked_ptr<RulesRegistry::Rule> CreateRule1() {
83 ListValue* scheme_http = new ListValue(); 83 ListValue* scheme_http = new ListValue();
84 scheme_http->Append(Value::CreateStringValue("http")); 84 scheme_http->Append(Value::CreateStringValue("http"));
85 DictionaryValue* http_condition_dict = new DictionaryValue(); 85 DictionaryValue* http_condition_dict = new DictionaryValue();
86 http_condition_dict->Set(keys2::kSchemesKey, scheme_http); 86 http_condition_dict->Set(keys2::kSchemesKey, scheme_http);
87 http_condition_dict->SetString(keys2::kHostSuffixKey, "example.com"); 87 http_condition_dict->SetString(keys2::kHostSuffixKey, "example.com");
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // The redirect by the first extension is ignored due to the ignore rule. 420 // The redirect by the first extension is ignored due to the ignore rule.
421 ASSERT_EQ(1u, deltas.size()); 421 ASSERT_EQ(1u, deltas.size());
422 LinkedPtrEventResponseDelta effective_rule = *(deltas.begin()); 422 LinkedPtrEventResponseDelta effective_rule = *(deltas.begin());
423 423
424 EXPECT_EQ(kExtensionId2, effective_rule->extension_id); 424 EXPECT_EQ(kExtensionId2, effective_rule->extension_id);
425 EXPECT_EQ(base::Time() + base::TimeDelta::FromDays(2), 425 EXPECT_EQ(base::Time() + base::TimeDelta::FromDays(2),
426 effective_rule->extension_install_time); 426 effective_rule->extension_install_time);
427 EXPECT_EQ(GURL("http://www.bar.com"), effective_rule->new_url); 427 EXPECT_EQ(GURL("http://www.bar.com"), effective_rule->new_url);
428 } 428 }
429 } // namespace extensions 429 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698