| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 void DurableStorageBrowserTest::SetUpCommandLine( | 60 void DurableStorageBrowserTest::SetUpCommandLine( |
| 61 base::CommandLine* command_line) { | 61 base::CommandLine* command_line) { |
| 62 command_line->AppendSwitch( | 62 command_line->AppendSwitch( |
| 63 switches::kEnableExperimentalWebPlatformFeatures); | 63 switches::kEnableExperimentalWebPlatformFeatures); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void DurableStorageBrowserTest::SetUpOnMainThread() { | 66 void DurableStorageBrowserTest::SetUpOnMainThread() { |
| 67 if (embedded_test_server()->Started()) | 67 if (embedded_test_server()->Started()) |
| 68 return; | 68 return; |
| 69 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 69 ASSERT_TRUE(embedded_test_server()->Start()); |
| 70 url_ = embedded_test_server()->GetURL("/durable/durability-permissions.html"); | 70 url_ = embedded_test_server()->GetURL("/durable/durability-permissions.html"); |
| 71 } | 71 } |
| 72 | 72 |
| 73 IN_PROC_BROWSER_TEST_F(DurableStorageBrowserTest, QueryNonBookmarkedPage) { | 73 IN_PROC_BROWSER_TEST_F(DurableStorageBrowserTest, QueryNonBookmarkedPage) { |
| 74 ui_test_utils::NavigateToURL(browser(), url_); | 74 ui_test_utils::NavigateToURL(browser(), url_); |
| 75 std::string permission_string; | 75 std::string permission_string; |
| 76 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 76 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 77 GetRenderFrameHost(), "checkPermission()", &permission_string)); | 77 GetRenderFrameHost(), "checkPermission()", &permission_string)); |
| 78 EXPECT_EQ("default", permission_string); | 78 EXPECT_EQ("default", permission_string); |
| 79 } | 79 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(GetRenderFrameHost(browser), | 167 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(GetRenderFrameHost(browser), |
| 168 "requestPermission()", | 168 "requestPermission()", |
| 169 &default_box_is_persistent)); | 169 &default_box_is_persistent)); |
| 170 EXPECT_TRUE(default_box_is_persistent); | 170 EXPECT_TRUE(default_box_is_persistent); |
| 171 | 171 |
| 172 std::string permission_string; | 172 std::string permission_string; |
| 173 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 173 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 174 GetRenderFrameHost(browser), "checkPermission()", &permission_string)); | 174 GetRenderFrameHost(browser), "checkPermission()", &permission_string)); |
| 175 EXPECT_EQ("granted", permission_string); | 175 EXPECT_EQ("granted", permission_string); |
| 176 } | 176 } |
| OLD | NEW |