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
3// found in the LICENSE file.
4
5#include "base/command_line.h"
6#include "chrome/browser/extensions/extension_apitest.h"
7#include "chrome/test/base/ui_test_utils.h"
8
9namespace extensions {
10
11// Times out on win syzyasan, http://crbug.com/166026
12#if defined(SYZYASAN)
13#define MAYBE_Cookies DISABLED_Cookies
14#else
15#define MAYBE_Cookies Cookies
16#endif
17IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Cookies) {
18  ASSERT_TRUE(RunExtensionTest("cookies/api")) << message_;
19}
20
21IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CookiesEvents) {
22  ASSERT_TRUE(RunExtensionTest("cookies/events")) << message_;
23}
24
25IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CookiesEventsSpanning) {
26  // We need to initialize an incognito mode window in order have an initialized
27  // incognito cookie store. Otherwise, the chrome.cookies.set operation is just
28  // ignored and we won't be notified about a newly set cookie for which we want
29  // to test whether the storeId is set correctly.
30  ui_test_utils::OpenURLOffTheRecord(browser()->profile(),
31                                     GURL("chrome://newtab/"));
32  ASSERT_TRUE(RunExtensionTestIncognito("cookies/events_spanning")) << message_;
33}
34
35IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CookiesNoPermission) {
36  ASSERT_TRUE(RunExtensionTest("cookies/no_permission")) << message_;
37}
38
39}  // namespace extensions
40