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

Side by Side Diff: extensions/browser/api/runtime/runtime_apitest.cc

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (extension-notifications) rebase Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/api/runtime/runtime_api.cc ('k') | extensions/browser/api/test/test_api.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 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 "chrome/browser/apps/app_browsertest_util.h" 5 #include "chrome/browser/apps/app_browsertest_util.h"
6 #include "chrome/browser/extensions/api/management/management_api.h" 6 #include "chrome/browser/extensions/api/management/management_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_function_test_utils.h" 8 #include "chrome/browser/extensions/extension_function_test_utils.h"
9 #include "chrome/browser/extensions/test_extension_dir.h" 9 #include "chrome/browser/extensions/test_extension_dir.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 const Extension* extension = LoadExtension(dir.unpacked_path()); 91 const Extension* extension = LoadExtension(dir.unpacked_path());
92 ASSERT_TRUE(extension); 92 ASSERT_TRUE(extension);
93 const std::string extension_id = extension->id(); 93 const std::string extension_id = extension->id();
94 94
95 // Somewhat arbitrary upper limit of 30 iterations. If the extension manages 95 // Somewhat arbitrary upper limit of 30 iterations. If the extension manages
96 // to reload itself that often without being terminated, the test fails 96 // to reload itself that often without being terminated, the test fails
97 // anyway. 97 // anyway.
98 for (int i = 0; i < 30; i++) { 98 for (int i = 0; i < 30; i++) {
99 content::WindowedNotificationObserver unload_observer( 99 content::WindowedNotificationObserver unload_observer(
100 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, 100 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
101 content::NotificationService::AllSources()); 101 content::NotificationService::AllSources());
102 content::WindowedNotificationObserver load_observer( 102 content::WindowedNotificationObserver load_observer(
103 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, 103 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
104 content::NotificationService::AllSources()); 104 content::NotificationService::AllSources());
105 105
106 ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait( 106 ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait(
107 extension_id, "chrome.runtime.reload();")); 107 extension_id, "chrome.runtime.reload();"));
108 unload_observer.Wait(); 108 unload_observer.Wait();
109 109
110 if (registry->GetExtensionById(extension_id, 110 if (registry->GetExtensionById(extension_id,
111 ExtensionRegistry::TERMINATED)) { 111 ExtensionRegistry::TERMINATED)) {
112 break; 112 break;
113 } else { 113 } else {
114 load_observer.Wait(); 114 load_observer.Wait();
115 WaitForExtensionViewsToLoad(); 115 WaitForExtensionViewsToLoad();
116 } 116 }
117 } 117 }
118 ASSERT_TRUE( 118 ASSERT_TRUE(
119 registry->GetExtensionById(extension_id, ExtensionRegistry::TERMINATED)); 119 registry->GetExtensionById(extension_id, ExtensionRegistry::TERMINATED));
120 } 120 }
121 121
122 } // namespace extensions 122 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/runtime/runtime_api.cc ('k') | extensions/browser/api/test/test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698