Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Delete deprecated goog.net.cookies.
Browse files Browse the repository at this point in the history
goog.net.cookies was deprecated and replaced by goog.net.Cookies some time ago. This change finally deletes the definition of goog.net.cookies.

RELNOTES: Delete deprecated goog.net.cookies.
PiperOrigin-RevId: 432329161
Change-Id: Id7fa33a47d2f2a5d83c918b90faebaa1320b3eea
  • Loading branch information
Closure Team authored and copybara-github committed Mar 4, 2022
1 parent b1f2691 commit 67d06cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
1 change: 0 additions & 1 deletion closure/goog/net/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ closure_js_library(
name = "cookies",
srcs = [
"cookies.js",
"cookies_deprecated.js",
],
lenient = True,
deps = ["//closure/goog/string"],
Expand Down
23 changes: 0 additions & 23 deletions closure/goog/net/cookies_deprecated.js

This file was deleted.

2 changes: 1 addition & 1 deletion closure/goog/net/cookies_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ goog.setTestOnly();

const Cookies = goog.require('goog.net.Cookies');
const PropertyReplacer = goog.require('goog.testing.PropertyReplacer');
const cookies = goog.require('goog.net.cookies');
const googArray = goog.require('goog.array');
const testSuite = goog.require('goog.testing.testSuite');

let baseCount = 0;
const cookies = Cookies.getInstance();
const stubs = new PropertyReplacer();

function checkForCookies() {
Expand Down
15 changes: 3 additions & 12 deletions closure/goog/ui/cookieeditor_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,15 @@ goog.module('goog.ui.CookieEditorTest');
goog.setTestOnly();

const CookieEditor = goog.require('goog.ui.CookieEditor');
const Cookies = goog.require('goog.net.Cookies');
const EventType = goog.require('goog.events.EventType');
const GoogEvent = goog.require('goog.events.Event');
const cookies = goog.require('goog.net.cookies');
const dom = goog.require('goog.dom');
const events = goog.require('goog.testing.events');
const testSuite = goog.require('goog.testing.testSuite');

const COOKIE_KEY = 'my_fabulous_cookie';
let COOKIE_VALUES;

cookies.get = (key) => COOKIE_VALUES[key];

cookies.set = (key, value) => COOKIE_VALUES[key] = value;

/** @suppress {missingReturn} suppression added to enable type checking */
cookies.remove = (key, value) => {
delete COOKIE_VALUES[key];
};
const cookies = Cookies.getInstance();

/** @suppress {visibility} suppression added to enable type checking */
function newCookieEditor(cookieValue = undefined) {
Expand All @@ -48,7 +39,7 @@ function newCookieEditor(cookieValue = undefined) {
testSuite({
setUp() {
dom.removeChildren(dom.getElement('test_container'));
COOKIE_VALUES = {};
cookies.remove(COOKIE_KEY);
},

testRender() {
Expand Down

0 comments on commit 67d06cf

Please sign in to comment.