OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "apps/launcher.h" | 9 #include "apps/launcher.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_TEST)); | 1030 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_TEST)); |
1031 | 1031 |
1032 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 1032 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
1033 ASSERT_FALSE(should_not_install.seen()); | 1033 ASSERT_FALSE(should_not_install.seen()); |
1034 | 1034 |
1035 // Simulate a "downgrade" from version 2 in the test manifest.json to 1. | 1035 // Simulate a "downgrade" from version 2 in the test manifest.json to 1. |
1036 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(browser()->profile()); | 1036 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(browser()->profile()); |
1037 | 1037 |
1038 // Clear the registered events to ensure they are updated. | 1038 // Clear the registered events to ensure they are updated. |
1039 extensions::EventRouter::Get(browser()->profile()) | 1039 extensions::EventRouter::Get(browser()->profile()) |
1040 ->SetRegisteredEvents(extension->id(), std::set<std::string>()); | 1040 ->ClearRegisteredEventsForTest(extension->id()); |
1041 | 1041 |
1042 DictionaryPrefUpdate update(extension_prefs->pref_service(), | 1042 DictionaryPrefUpdate update(extension_prefs->pref_service(), |
1043 extensions::pref_names::kExtensions); | 1043 extensions::pref_names::kExtensions); |
1044 base::DictionaryValue* dict = update.Get(); | 1044 base::DictionaryValue* dict = update.Get(); |
1045 std::string key(extension->id()); | 1045 std::string key(extension->id()); |
1046 key += ".manifest.version"; | 1046 key += ".manifest.version"; |
1047 dict->SetString(key, "1"); | 1047 dict->SetString(key, "1"); |
1048 } | 1048 } |
1049 | 1049 |
1050 // Component App Test 3 of 3: simulate a component extension upgrade that | 1050 // Component App Test 3 of 3: simulate a component extension upgrade that |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 } | 1365 } |
1366 | 1366 |
1367 // Sends chrome.test.sendMessage from chrome.app.window.create's callback. | 1367 // Sends chrome.test.sendMessage from chrome.app.window.create's callback. |
1368 // The app window also adds an <iframe> to the page during window.onload. | 1368 // The app window also adds an <iframe> to the page during window.onload. |
1369 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWindowIframe) { | 1369 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWindowIframe) { |
1370 LoadAndLaunchPlatformApp("app_window_send_message", | 1370 LoadAndLaunchPlatformApp("app_window_send_message", |
1371 "APP_WINDOW_CREATE_CALLBACK"); | 1371 "APP_WINDOW_CREATE_CALLBACK"); |
1372 } | 1372 } |
1373 | 1373 |
1374 } // namespace extensions | 1374 } // namespace extensions |
OLD | NEW |