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

Side by Side Diff: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc

Issue 8498007: ContentSettingsObserver (+ related classes) cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing struct ContentSettings, too. Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/content_settings/content_settings_pref_provider.h" 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int setting_value; 46 int setting_value;
47 ASSERT_TRUE(one_origin_settings->GetIntegerWithoutPathExpansion( 47 ASSERT_TRUE(one_origin_settings->GetIntegerWithoutPathExpansion(
48 std::string(secondary_origin.spec()), &setting_value)); 48 std::string(secondary_origin.spec()), &setting_value));
49 EXPECT_EQ(expected_setting, setting_value); 49 EXPECT_EQ(expected_setting, setting_value);
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 namespace content_settings { 54 namespace content_settings {
55 55
56 bool SettingsEqual(const ContentSettings& settings1,
57 const ContentSettings& settings2) {
58 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) {
59 if (settings1.settings[i] != settings2.settings[i])
60 return false;
61 }
62 return true;
63 }
64
65 class DeadlockCheckerThread : public base::PlatformThread::Delegate { 56 class DeadlockCheckerThread : public base::PlatformThread::Delegate {
66 public: 57 public:
67 explicit DeadlockCheckerThread(PrefProvider* provider) 58 explicit DeadlockCheckerThread(PrefProvider* provider)
68 : provider_(provider) {} 59 : provider_(provider) {}
69 60
70 virtual void ThreadMain() { 61 virtual void ThreadMain() {
71 bool got_lock = provider_->lock_.Try(); 62 bool got_lock = provider_->lock_.Try();
72 EXPECT_TRUE(got_lock); 63 EXPECT_TRUE(got_lock);
73 if (got_lock) 64 if (got_lock)
74 provider_->lock_.Release(); 65 provider_->lock_.Release();
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 DictionaryValue* mutable_settings = update.Get(); 862 DictionaryValue* mutable_settings = update.Get();
872 mutable_settings->SetWithoutPathExpansion("www.example.com,*", 863 mutable_settings->SetWithoutPathExpansion("www.example.com,*",
873 new base::DictionaryValue()); 864 new base::DictionaryValue());
874 } 865 }
875 EXPECT_TRUE(observer.notification_received()); 866 EXPECT_TRUE(observer.notification_received());
876 867
877 provider.ShutdownOnUIThread(); 868 provider.ShutdownOnUIThread();
878 } 869 }
879 870
880 } // namespace content_settings 871 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698